rake_shared_context 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5521673b9b6201456c829e516c25bd616f3b092d
4
+ data.tar.gz: 1bc74c362473e4ad4da113bbac06c0304bc6bdc8
5
+ SHA512:
6
+ metadata.gz: d7c1cfdc3919cec4232493102fd8de052294da9e7702064350dcdf4fe548faa90e015899edbb3a3f71b42fa82b6c8c2a5771faac948bdb3903ff238757549ca0
7
+ data.tar.gz: 5077431efc9192f621ce87858d7745b38d838e93748309386d164395dc7c5e48d4d9e26b1272ec8b6b26da54afda44774c1938103f51a30374e070c803d5f8e6
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 0.0.2
2
+
3
+ * load all rake task under lib/tasks/
4
+
5
+ ## 0.0.1
6
+
7
+ * initial release
data/README.md CHANGED
@@ -37,15 +37,16 @@ Then you can write following.
37
37
 
38
38
  ~~~
39
39
  # spec/lib/tasks/reports_rake_spec.rb
40
+
41
+ require 'spec_helper'
40
42
  describe "reports:genereate" do
41
43
  include_context "rake"
42
- before { ReportGenerator.stubs(:generate) }
43
44
 
44
45
  its(:prerequisites) { should include("environment") }
45
46
 
46
47
  it "generates the report" do
48
+ ReportGenerator.should_receive(:generate)
47
49
  subject.invoke
48
- ReportGenerator.should have_received(:generate)
49
50
  end
50
51
  end
51
52
  ~~~
@@ -53,7 +54,6 @@ end
53
54
  ## Details
54
55
 
55
56
  * It expects that rake files are located under lib/tasks
56
- * It expects that file name is equal to task name so that you should write 'reports:generate' task at lib/tasks/reports.rake
57
57
  * It expects that a argument is passed to `describe` is task name
58
58
 
59
59
  ## Contributing
@@ -1,3 +1,3 @@
1
1
  module RakeSharedContext
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -6,17 +6,15 @@ begin
6
6
  shared_context "rake" do
7
7
  let(:rake) { Rake::Application.new }
8
8
  let(:task_name) { self.class.top_level_description }
9
- let(:task_path) { "lib/tasks/#{task_name.split(":").first}" }
10
9
  subject { rake[task_name] }
11
10
 
12
- def loaded_files_excluding_current_rake_file
13
- $".reject {|file| file == Rails.root.join("#{task_path}.rake").to_s }
14
- end
15
-
16
11
  before do
12
+ loaded_files = []
17
13
  Rake.application = rake
18
- Rake.application.rake_require(task_path, [Rails.root.to_s], loaded_files_excluding_current_rake_file)
19
-
14
+ Dir::glob("lib/tasks/*.rake").each do |task|
15
+ Rake.application.rake_require(task.sub(/.rake$/,''), [Rails.root.to_s], loaded_files)
16
+ end
17
+
20
18
  Rake::Task.define_task(:environment)
21
19
  end
22
20
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_shared_context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - willnet
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-10-03 00:00:00.000000000 Z
11
+ date: 2013-04-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: shared_context for rake task
@@ -35,6 +32,7 @@ extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
37
34
  - .gitignore
35
+ - CHANGELOG.md
38
36
  - Gemfile
39
37
  - LICENSE
40
38
  - README.md
@@ -44,26 +42,25 @@ files:
44
42
  - rake_shared_context.gemspec
45
43
  homepage: ''
46
44
  licenses: []
45
+ metadata: {}
47
46
  post_install_message:
48
47
  rdoc_options: []
49
48
  require_paths:
50
49
  - lib
51
50
  required_ruby_version: !ruby/object:Gem::Requirement
52
- none: false
53
51
  requirements:
54
- - - ! '>='
52
+ - - '>='
55
53
  - !ruby/object:Gem::Version
56
54
  version: '0'
57
55
  required_rubygems_version: !ruby/object:Gem::Requirement
58
- none: false
59
56
  requirements:
60
- - - ! '>='
57
+ - - '>='
61
58
  - !ruby/object:Gem::Version
62
59
  version: '0'
63
60
  requirements: []
64
61
  rubyforge_project:
65
- rubygems_version: 1.8.23
62
+ rubygems_version: 2.0.0
66
63
  signing_key:
67
- specification_version: 3
64
+ specification_version: 4
68
65
  summary: shared_context for rake task
69
66
  test_files: []