diff --git a/.gitignore b/.gitignore index b418ad46..0dc4677e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ /.bundle /.emacs-project /.redcar -/bin /coverage /db/*.db /db/*.sqlite3 diff --git a/.travis.yml b/.travis.yml index 5eeee3cb..91bfd9e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: - "cp config/site.yml.tmpl config/site.yml" - "cp config/database.yml.tmpl config/database.yml" -script: "CODECLIMATE_REPO_TOKEN=5c52fdd2bbcd0734d56ddb2c3cbaac782da345273e8689d25f54a065ccc3397c bundle exec rake ci RACK_ENV=test" +script: "CODECLIMATE_REPO_TOKEN=5c52fdd2bbcd0734d56ddb2c3cbaac782da345273e8689d25f54a065ccc3397c bin/rake ci RACK_ENV=test" notifications: email: false diff --git a/Gemfile b/Gemfile index 4b012496..40da7701 100644 --- a/Gemfile +++ b/Gemfile @@ -42,6 +42,8 @@ gem 'bcrypt-ruby', '~> 3.0.0' # gem 'jbuilder', '~> 1.2' group :development do + gem "spring" + gem "spring-commands-cucumber" gem "yard" gem 'tolk', '>=1.5.0' gem "bullet" diff --git a/Gemfile.lock b/Gemfile.lock index 1e6e36f6..545561ec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -167,6 +167,9 @@ GEM multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) + spring (1.1.3) + spring-commands-cucumber (1.0.1) + spring (>= 0.9.1) sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) @@ -235,6 +238,8 @@ DEPENDENCIES sass-rails (~> 4.0) selenium-webdriver simplecov + spring + spring-commands-cucumber sqlite3 swf_fu therubyracer diff --git a/app/views/integrations/index.de.html.erb b/app/views/integrations/index.de.html.erb index efaa2136..70bc29d2 100644 --- a/app/views/integrations/index.de.html.erb +++ b/app/views/integrations/index.de.html.erb @@ -105,7 +105,7 @@ "<%= Preference.human_attribute_name('sms_context') %>" for todos sent in via email (which could come from an SMS message)
  • In sendmail/qmail/postfix/whatever, set up an email address - alias to pipe messages to
    /usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
  • + alias to pipe messages to
    /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
  • Send an email to your newly configured address!
  • You can also use the Rich Todo API to send in tasks like "do laundry @ Home" @@ -116,7 +116,7 @@ You may need to configure your site.yml to tell the message gateway to look at the to: field or from: field to lookup Tracks' user from the email address in that field.

    You can also send all email to a specific Tracks user. Configure mail_dispatch in site.yml to single_user and pass the login of the user: -

    TRACKS_MAIL_RECEIVER=<%=current_user.login%> usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
    +
    TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'

    diff --git a/app/views/integrations/index.en.html.erb b/app/views/integrations/index.en.html.erb index 0dc900a2..55bafc63 100644 --- a/app/views/integrations/index.en.html.erb +++ b/app/views/integrations/index.en.html.erb @@ -107,7 +107,7 @@ "<%= Preference.human_attribute_name('sms_context') %>" for todos sent in via email (which could come from an SMS message)
  • In sendmail/qmail/postfix/whatever, set up an email address - alias to pipe messages to
    /usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
  • + alias to pipe messages to
    /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
  • Send an email to your newly configured address!
  • You can also use the Rich Todo API to send in tasks like "do laundry @ Home" @@ -118,7 +118,7 @@ You may need to configure your site.yml to tell the message gateway to look at the to: field or from: field to lookup Tracks' user from the email address in that field.

    You can also send all email to a specific Tracks user. Configure mail_dispatch in site.yml to single_user and pass the login of the user: -

    TRACKS_MAIL_RECEIVER=<%=current_user.login%> usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
    +
    TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'

    diff --git a/app/views/integrations/index.nl.html.erb b/app/views/integrations/index.nl.html.erb index aaf6abcb..666f78f9 100644 --- a/app/views/integrations/index.nl.html.erb +++ b/app/views/integrations/index.nl.html.erb @@ -109,7 +109,7 @@ verzonden zijn via email (die bijv. komen via een SMS message)
  • In sendmail/qmail/postfix/whatever, stel een email address alias in om berichten door te sturen naar -
    /usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
  • +
    /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'
  • Verstuur een email naar het net geconfigureerde e-mail adres!
  • Je kan ook de Rich Todo API gebruiken om acties te maken zoals "do laundry @ Home" @@ -120,7 +120,7 @@ Het kan nodig zijn om jouw site.yml te configureren om de message gateway te laten kijken naar het to: veld of het from: veld om de Tracks-gebruiker op te zoeken met het emailadres uit dat veld.

    Je kan ook alle email naar een specifieke Tracks gebruiker sturen. Stel mail_dispatch in site.yml in op single_user en geeft de login van de gebruiker door: -

    TRACKS_MAIL_RECEIVER=<%=current_user.login%> usr/bin/bundle exec /PATH/TO/TRACKS/script/rails r -e production 'MessageGateway.receive(STDIN.read)'
    +
    TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'

    diff --git a/bin/cucumber b/bin/cucumber new file mode 100755 index 00000000..12971cdc --- /dev/null +++ b/bin/cucumber @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end +require 'bundler/setup' +load Gem.bin_path('cucumber', 'cucumber') diff --git a/script/rails b/bin/rails similarity index 79% rename from script/rails rename to bin/rails index f8da2cff..1c894d52 100755 --- a/script/rails +++ b/bin/rails @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) diff --git a/bin/rake b/bin/rake new file mode 100755 index 00000000..0fb4e07e --- /dev/null +++ b/bin/rake @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end +require 'bundler/setup' +load Gem.bin_path('rake', 'rake') diff --git a/bin/spring b/bin/spring new file mode 100755 index 00000000..253ec37c --- /dev/null +++ b/bin/spring @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast +# It gets overwritten when you run the `spring binstub` command + +unless defined?(Spring) + require "rubygems" + require "bundler" + + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) + ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) + ENV["GEM_HOME"] = "" + Gem.paths = ENV + + gem "spring", match[1] + require "spring/binstub" + end +end diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 7aebb556..eaa8ba23 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -16,6 +16,8 @@ == Version 2.3devel New and changed features +* Added new binstubs. The commands `bin/rails` and `bin/rake` take the place of + the old `bundle exec rails` and `bundle exec rake`, respectively. * You can select to group todos on the home page by context or by project (using the view menu). This also works for tag page, the project page, the tickler and the context page diff --git a/doc/installation.textile b/doc/installation.textile index 5ac6628d..a0e1f60f 100644 --- a/doc/installation.textile +++ b/doc/installation.textile @@ -60,7 +60,7 @@ h2. Configure variables # In the @config@ folder, copy the files @database.yml.tmpl@ and @site.yml.tmpl@ to @database.yml@ and @site.yml@, respectively. # Open the file @config/database.yml@ and edit the @production:@ section with the details of your database. If you are using MySQL the @adapter:@ line should read @adapter: mysql2@, @host: localhost@ (in the majority of cases), and your username and password should match those you assigned when you created the database. If you are using SQLite3, you should have only two lines under the production section: @adapter: sqlite3@ and @database: db/tracks.db@. -# Open the file @config/site.yml@, and read through the settings to make sure that they suit your setup. In most cases, all you need to change are the @salt: "change-me"@ line (change the string "change-me" to some other string of your choice), the administrator email address (@admin_email@), and the time zone setting. For the time zone setting you can use the command @bundle exec rake time:zones:local@ to see all available timezones on your machine +# Open the file @config/site.yml@, and read through the settings to make sure that they suit your setup. In most cases, all you need to change are the @salt: "change-me"@ line (change the string "change-me" to some other string of your choice), the administrator email address (@admin_email@), and the time zone setting. For the time zone setting you can use the command @bin/rake time:zones:local@ to see all available timezones on your machine # If you are using Windows, you may need to check the 'shebang' lines (@#!/usr/bin/env ruby@) of the @/public/dispatch.*@ files and all the files in the @/script@ directory. They are set to @#!/usr/bin/env ruby@ by default. This should work for all Unix based setups (Linux or Mac OS X), but Windows users will probably have to change it to something like @#c:/ruby/bin/ruby@ to point to the Ruby binary on your system. # If you intend to deploy Tracks with the built in webserver called WEBrick, you'll need to change @config.serve_static_assets@ to @true@ in @config/environments/production.rb@ in order for the images, stylesheets, and javascript files to be served correctly. @@ -69,7 +69,7 @@ h2. Populate your database with the Tracks schema Open a terminal and change into the root of your Tracks directory. Enter the following command: -bc. bundle exec rake db:migrate RAILS_ENV=production +bc. bin/rake db:migrate RAILS_ENV=production This will set up your database with the required structure to hold Tracks' data. @@ -78,14 +78,14 @@ h2. Precompile assets Static assets (images, stylesheets, and javascript) need to be compiled in order for them to work correctly with the new asset pipeline feature in Rails. Precompiling your assets is as simple as running the following command while inside the Tracks root directory: -bc. bundle exec rake assets:precompile +bc. bin/rake assets:precompile h2. Start the server While still in the Terminal inside the Tracks root directory, issue the following command: -bc. bundle exec rails server -e production +bc. bin/rails server -e production If all goes well, you should see some text informing you that the WEBrick server is running: @=> Rails application starting in production on http://0.0.0.0:3000@. If you are already running other services on port 3000, you need to select a different port when running the server, using the @-p@ option. diff --git a/doc/upgrading.textile b/doc/upgrading.textile index ba19f75d..2c71375e 100644 --- a/doc/upgrading.textile +++ b/doc/upgrading.textile @@ -9,9 +9,9 @@ That said. To upgrade: # Install Tracks 2.3devel in a new directory. Or you can create a separate installation of 2.3 for testing purposes. # Copy over the configuration from your previous Tracks installation. If using SQLite3, copy the old database into the new Tracks 2.3devel directory. # Check that you have all dependencies installed: @bundle install --without development test@ Or leave out the @--without development test@ part if you intent to test or develop on this tree. -# Run @bundle exec rake db:migrate RAILS_ENV=production@ to update your old database to the new schema. This is the point of no return. Make sure you have backups! -# Precompile your static assets (css, javascript, etc.) by running @bundle exec rake assets:precompile@. -# Run @bundle exec rails server -e production@ inside your Tracks 2.3devel directory to start up Tracks. Or use @-e development@ if you intent to try your changes and get more log info. +# Run @bin/rake db:migrate RAILS_ENV=production@ to update your old database to the new schema. This is the point of no return. Make sure you have backups! +# Precompile your static assets (css, javascript, etc.) by running @bin/rake assets:precompile@. +# Run @bin/rails server -e production@ inside your Tracks 2.3devel directory to start up Tracks. Or use @-e development@ if you intent to try your changes and get more log info. Please note that if you intend to use Tracks with the built in webserver called WEBrick for production, you'll need to change @config.serve_static_assets@ to @true@ in @config/environments/production.rb@ in order for the images, stylesheets, and javascript files to be served correctly. diff --git a/script/cucumber b/script/cucumber deleted file mode 100755 index 7fa5c920..00000000 --- a/script/cucumber +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby - -vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first -if vendored_cucumber_bin - load File.expand_path(vendored_cucumber_bin) -else - require 'rubygems' unless ENV['NO_RUBYGEMS'] - require 'cucumber' - load Cucumber::BINARY -end