bard-rake 0.9.4 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.4
1
+ 0.10.0
data/bard-rake.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bard-rake"
8
- s.version = "0.9.4"
8
+ s.version = "0.10.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Micah Geisel"]
@@ -26,9 +26,10 @@ Gem::Specification.new do |s|
26
26
  "lib/bard-rake.rb",
27
27
  "lib/bard/rake.rb",
28
28
  "lib/bard/rake/bootstrap.rb",
29
- "lib/bard/rake/bundler.rb",
30
- "lib/bard/rake/db.rb",
29
+ "lib/bard/rake/db_dump_load.rb",
30
+ "lib/bard/rake/db_migrate_sanity.rb",
31
31
  "lib/bard/rake/railtie.rb",
32
+ "lib/bard/rake/testing.rb",
32
33
  "spec/bard-rake_spec.rb",
33
34
  "spec/spec.opts",
34
35
  "spec/spec_helper.rb"
data/lib/bard/rake.rb CHANGED
@@ -1,3 +1,8 @@
1
- require 'bard/rake/bundler'
2
- require 'bard/rake/db'
1
+ require 'bard/rake/db_dump_load'
2
+ require 'bard/rake/db_migrate_sanity'
3
3
  require 'bard/rake/bootstrap'
4
+ require 'bard/rake/testing'
5
+
6
+ def invoke_task_if_exists task_name
7
+ Rake::Task[task_name].invoke if Rake::Task.task_defined? task_name
8
+ end
@@ -1,6 +1,5 @@
1
1
  task :restart do
2
2
  system "touch tmp/restart.txt"
3
- system "touch tmp/debug.txt" if ENV["DEBUG"] == 'true'
4
3
  end
5
4
 
6
5
  desc "Bootstrap project"
@@ -10,46 +9,12 @@ task :bootstrap => "bootstrap:files" do
10
9
  Rake::Task["restart"].invoke
11
10
  end
12
11
 
13
- namespace :db do
14
- namespace :migrate do
15
- task :all => [:load_config, :rails_env] do
16
- configs_for_environment.each do |config|
17
- ActiveRecord::Base.establish_connection(config)
18
- ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
19
- ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) do |migration|
20
- ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
21
- end
22
- end
23
-
24
- Rake::Task["db:_dump"].invoke
25
- end
26
- end
27
-
28
- namespace :rollback do
29
- task :all => [:load_config, :rails_env] do
30
- configs_for_environment.each do |config|
31
- ActiveRecord::Base.establish_connection(config)
32
- step = ENV['STEP'] ? ENV['STEP'].to_i : 1
33
- ActiveRecord::Migrator.rollback(ActiveRecord::Migrator.migrations_paths, step)
34
- end
35
-
36
- Rake::Task["db:_dump"].invoke
37
- end
38
- end
39
- end
40
-
41
12
  namespace :bootstrap do
42
13
  desc "Bootstrap project to run in production"
43
14
  task :production => "bootstrap:files" do
44
15
  invoke_task_if_exists "db:create"
45
16
  invoke_task_if_exists "db:migrate"
46
17
 
47
- if %w(app/stylesheets app/sass public/stylesheets/sass).any? { |file| File.exist?(file) }
48
- Sass::Plugin.options[:always_update] = true;
49
- Sass::Plugin.update_stylesheets
50
- end
51
- invoke_task_if_exists "barista:brew"
52
- invoke_task_if_exists "asset:packager:build_all"
53
18
  invoke_task_if_exists "assets:precompile"
54
19
  invoke_task_if_exists "bootstrap:production:post"
55
20
  Rake::Task["restart"].invoke
@@ -61,44 +26,6 @@ namespace :bootstrap do
61
26
  end
62
27
 
63
28
  task :files do
64
- system "git submodule sync"
65
- system "git submodule init"
66
- system "git submodule update --merge"
67
- system "git submodule foreach 'git checkout `git name-rev --name-only HEAD`'"
68
29
  system "cp config/database.sample.yml config/database.yml" unless File.exist?('config/database.yml') or !File.exist?('config/database.sample.yml')
69
30
  end
70
31
  end
71
-
72
- Rake::Task[:default].clear if Rake::Task.task_defined?(:default)
73
- desc "Bootstrap the current project and run the tests."
74
- task :default => [:bootstrap_test] do
75
- invoke_task_if_exists "spec"
76
- invoke_task_if_exists "cucumber"
77
- invoke_task_if_exists "spec:javascripts"
78
- end
79
-
80
- task :bootstrap_test => [:set_test_env, :bootstrap]
81
-
82
- task :ci => [:set_ci_env, :set_fail_fast_env, :bootstrap_test, "assets:clean:all", "assets:precompile", :default]
83
-
84
- task :set_ci_env do
85
- ENV["CI"] = "1"
86
- end
87
-
88
- task :set_fail_fast_env do
89
- ENV["FAIL_FAST"] = "1"
90
- end
91
-
92
- task :set_test_env do
93
- ENV["RAILS_ENV"] = "test"
94
- RAILS_ENV = "test"
95
- end
96
-
97
- def invoke_task_if_exists task_name
98
- Rake::Task[task_name].invoke if Rake::Task.task_defined? task_name
99
- end
100
-
101
- begin
102
- require "rspec/core/rake_task"
103
- RSpec::Core::RakeTask.new(:spec)
104
- rescue LoadError; end
File without changes
@@ -0,0 +1,27 @@
1
+ namespace :db do
2
+ namespace :migrate do
3
+ task :all => [:load_config, :rails_env] do
4
+ configs_for_environment.each do |config|
5
+ ActiveRecord::Base.establish_connection(config)
6
+ ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
7
+ ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) do |migration|
8
+ ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
9
+ end
10
+ end
11
+
12
+ Rake::Task["db:_dump"].invoke
13
+ end
14
+ end
15
+
16
+ namespace :rollback do
17
+ task :all => [:load_config, :rails_env] do
18
+ configs_for_environment.each do |config|
19
+ ActiveRecord::Base.establish_connection(config)
20
+ step = ENV['STEP'] ? ENV['STEP'].to_i : 1
21
+ ActiveRecord::Migrator.rollback(ActiveRecord::Migrator.migrations_paths, step)
22
+ end
23
+
24
+ Rake::Task["db:_dump"].invoke
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,37 @@
1
+ # ensure spec task is defined if rspec is in the project
2
+ begin
3
+ require "rspec/core/rake_task"
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ rescue LoadError; end
6
+
7
+ task :set_test_env do
8
+ ENV["RAILS_ENV"] = "test"
9
+ RAILS_ENV = "test"
10
+ end
11
+
12
+ task :bootstrap_test => [:set_test_env, :bootstrap]
13
+
14
+ task :parallel => ["parallel:create", "parallel:prepare", "parallel:features"]
15
+
16
+ Rake::Task[:default].clear if Rake::Task.task_defined?(:default)
17
+ desc "Bootstrap the current project and run the tests."
18
+ task :default => [:bootstrap_test] do
19
+ invoke_task_if_exists "spec"
20
+ require "debugger"; debugger
21
+ if ENV["CI"] && Rake::Task.task_defined?("parallel:features")
22
+ Rake::Task[:parallel].invoke
23
+ else
24
+ invoke_task_if_exists "cucumber"
25
+ end
26
+ invoke_task_if_exists "spec:javascripts"
27
+ end
28
+
29
+ task :ci => [:set_ci_env, :set_fail_fast_env, :bootstrap_test, "assets:clean:all", "assets:precompile", :default]
30
+
31
+ task :set_ci_env do
32
+ ENV["CI"] = "1"
33
+ end
34
+
35
+ task :set_fail_fast_env do
36
+ ENV["FAIL_FAST"] = "1"
37
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-rake
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 55
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 9
9
- - 4
10
- version: 0.9.4
8
+ - 10
9
+ - 0
10
+ version: 0.10.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Micah Geisel
@@ -55,9 +55,10 @@ files:
55
55
  - lib/bard-rake.rb
56
56
  - lib/bard/rake.rb
57
57
  - lib/bard/rake/bootstrap.rb
58
- - lib/bard/rake/bundler.rb
59
- - lib/bard/rake/db.rb
58
+ - lib/bard/rake/db_dump_load.rb
59
+ - lib/bard/rake/db_migrate_sanity.rb
60
60
  - lib/bard/rake/railtie.rb
61
+ - lib/bard/rake/testing.rb
61
62
  - spec/bard-rake_spec.rb
62
63
  - spec/spec.opts
63
64
  - spec/spec_helper.rb
@@ -1,13 +0,0 @@
1
- # clear out rails 2.3's gems tasks if bundler is used for the current project
2
- def bundler_used?
3
- File.exist? "Gemfile"
4
- end
5
-
6
- def is_rails_2?
7
- Rake::Task.tasks.include?(:gems)
8
- end
9
-
10
- if bundler_used? and is_rails_2?
11
- Rake::Task[:gems].clear
12
- Rake::Task[:"gems:install"].clear
13
- end