nake 0.0.7 → 0.0.8.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,5 +4,5 @@
4
4
  # You might think this is a terrible mess and guess what, you're
5
5
  # right mate! However say thanks to authors of RubyGems, not me.
6
6
  eval(File.read("nake.gemspec")).tap do |specification|
7
- specification.version = "#{Nake::VERSION}.pre"
7
+ specification.version = "#{specification.version}.pre"
8
8
  end
@@ -0,0 +1,10 @@
1
+ ~ If you want to contribute to nake, you have to install code-cleaner gem and then run ./tasks.rb hooks:whitespace:install to get Git pre-commit hook for removing trailing whitespace and improving code quality in general.
2
+ ~ Config {:gemspec=>"nake.pre.gemspec"}
3
+ ~ Config {:files=>["nake-0.0.8.pre.gem"]}
4
+ ~ Config {:gemspec=>"nake.pre.gemspec"}
5
+ ~ Executing task prerelease with arguments [] and options {}
6
+ ~ Invoking task release:gemcutter
7
+ ~ Executing task clean with arguments {} and options {}
8
+ ~ Executing task build with arguments {} and options {}
9
+ $ gem build nake.pre.gemspec
10
+ WARNING: no description specified
File without changes
File without changes
File without changes
@@ -0,0 +1,72 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+ require "nake/rule"
5
+
6
+ describe Nake::Rule do
7
+ before(:each) do
8
+ Nake::Rule.rules.clear
9
+ end
10
+
11
+ describe "[]" do
12
+ it "should find rule with given name if the name is a symbol"
13
+ it "should find rule with given name if the name is a string"
14
+ it "should find rule with given alias if the alias is a symbol"
15
+ it "should find rule with given alias if the alias is a string"
16
+ end
17
+
18
+ describe "[]=" do
19
+ it "should add the rule into the Nake::Rule.rules hash with stringified key"
20
+ end
21
+
22
+ describe ".rules" do
23
+ end
24
+
25
+ describe ".new" do
26
+ it "should returns already existing rule object if this object exists" do
27
+ rule = Nake::Rule.new(:release)
28
+ Nake::Rule.new(:release).object_id.should eql(rule.object_id)
29
+ end
30
+ end
31
+
32
+ it "should take name as a first argument" do
33
+ Nake::Rule.new("name").name.should eql(:name)
34
+ end
35
+
36
+ it "should take name as a first argument" do
37
+ Nake::Rule.new(:name).name.should eql(:name)
38
+ end
39
+
40
+ describe "#define" do
41
+ it "should puts block into the rule.blocks collection" do
42
+ rule = Nake::Rule.new(:name)
43
+ -> { rule.define { "a block" } }.should change { rule.blocks.length }.by(1)
44
+ end
45
+ end
46
+
47
+ describe "#hidden?" do
48
+ it "should not be hidden by default" do
49
+ rule = Nake::Rule.new(:name)
50
+ rule.should_not be_hidden
51
+ end
52
+
53
+ it "should be true if the rule is hidden" do
54
+ Nake::Rule.new(:name).tap do |rule|
55
+ rule.hidden = true
56
+ rule.should be_hidden
57
+ end
58
+ end
59
+
60
+ it "should be false if the rule isn't hidden" do
61
+ Nake::Rule.new(:name).tap do |rule|
62
+ rule.hidden = false
63
+ rule.should_not be_hidden
64
+ end
65
+ end
66
+ end
67
+
68
+ describe "#call" do
69
+ it "should call all dependencies"
70
+ it "should call all blocks of the given rule"
71
+ end
72
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,84 @@
1
+ # encoding: utf-8
2
+
3
+ require_relative "../spec_helper"
4
+ require "nake/template"
5
+
6
+ describe Nake::Template do
7
+ describe ".new" do
8
+ it "should take one argument with path to the file" do
9
+ -> { Nake::Template.new("spec/stubs/database.yml.tt") }.should_not raise_error
10
+ end
11
+ end
12
+
13
+ describe "#render" do
14
+ before(:each) do
15
+ @template = Nake::Template.new("spec/stubs/database.yml.tt")
16
+ end
17
+
18
+ it "should generate a string" do
19
+ output = @template.render(adapter: "sqlite3", name: "blog")
20
+ output.should match("database: blog_development")
21
+ output.should match("database: blog_test")
22
+ end
23
+ end
24
+ end
25
+
26
+ describe Nake::ErbTemplate do
27
+ describe ".new" do
28
+ it "should take one argument with path to the file" do
29
+ -> { Nake::ErbTemplate.new("spec/stubs/database.yml.erb") }.should_not raise_error
30
+ end
31
+ end
32
+
33
+ describe "#render" do
34
+ before(:each) do
35
+ @template = Nake::ErbTemplate.new("spec/stubs/database.yml.erb")
36
+ end
37
+
38
+ it "should generate a string" do
39
+ output = @template.render(adapter: "sqlite3", name: "blog")
40
+ output.should match("database: blog_development")
41
+ output.should match("database: blog_test")
42
+ end
43
+ end
44
+ end
45
+
46
+ describe Nake::TaskHelpers do
47
+ include Nake::TaskHelpers
48
+
49
+ after(:each) do
50
+ FileUtils.rm_rf "spec/stubs/database.yml"
51
+ end
52
+
53
+ describe "#template" do
54
+ before(:each) do
55
+ template "spec/stubs/database.yml.tt", "spec/stubs/database.yml", adapter: "sqlite3", name: "blog"
56
+ end
57
+
58
+ it "should create a new file" do
59
+ File.exist?("spec/stubs/database.yml").should be_true
60
+ end
61
+
62
+ it "should be filled with the data from the template" do
63
+ content = File.read("spec/stubs/database.yml")
64
+ content.should match("database: blog_development")
65
+ content.should match("database: blog_test")
66
+ end
67
+ end
68
+
69
+ describe "#erb" do
70
+ before(:each) do
71
+ erb "spec/stubs/database.yml.erb", "spec/stubs/database.yml", adapter: "sqlite3", name: "blog"
72
+ end
73
+
74
+ it "should create a new file" do
75
+ File.exist?("spec/stubs/database.yml").should be_true
76
+ end
77
+
78
+ it "should be filled with the data from the template" do
79
+ content = File.read("spec/stubs/database.yml")
80
+ content.should match("database: blog_development")
81
+ content.should match("database: blog_test")
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,9 @@
1
+ development:
2
+ adapter: <%= adapter %>
3
+ database: <%= name %>_development
4
+ username: root
5
+
6
+ test:
7
+ adapter: <%= adapter %>
8
+ database: <%= name %>_test
9
+ username: root
@@ -0,0 +1,9 @@
1
+ development:
2
+ adapter: %{adapter}
3
+ database: %{name}_development
4
+ username: root
5
+
6
+ test:
7
+ adapter: %{adapter}
8
+ database: %{name}_test
9
+ username: root
data/tasks.rb CHANGED
@@ -7,6 +7,10 @@ require "nake/tasks/release"
7
7
 
8
8
  begin
9
9
  load "code-cleaner.nake"
10
+ Nake::Task["hooks:whitespace:install"].tap do |task|
11
+ task.config[:encoding] = "utf-8"
12
+ task.config[:whitelist] = '(bin/[^/]+|.+\.(rb|rake|nake|thor|task))$'
13
+ end
10
14
  rescue LoadError
11
15
  warn "If you want to contribute to nake, you have to install code-cleaner gem and then run ./tasks.rb hooks:whitespace:install to get Git pre-commit hook for removing trailing whitespace and improving code quality in general."
12
16
  end
@@ -16,11 +20,6 @@ Task[:prerelease].config[:gemspec] = "nake.pre.gemspec"
16
20
  Task[:release].config[:name] = "nake"
17
21
  Task[:release].config[:version] = Nake::VERSION
18
22
 
19
- Nake::Task["hooks:whitespace:install"].tap do |task|
20
- task.config[:encoding] = "utf-8"
21
- task.config[:whitelist] = '(bin/[^/]+|.+\.(rb|rake|nake|thor|task))$'
22
- end
23
-
24
23
  Task.new(:features) do |task|
25
24
  task.description = "Run cucumber scenarios"
26
25
  task.define do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jakub \xC5\xA0\xC5\xA5astn\xC3\xBD aka Botanicus"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
- date: 2009-12-31 00:00:00 +01:00
11
+ date: 2010-01-10 00:00:00 +00:00
12
12
  default_executable: nake
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
@@ -30,81 +30,110 @@ extensions: []
30
30
  extra_rdoc_files: []
31
31
 
32
32
  files:
33
- - bin/nake
34
- - bm/bms.rb
35
- - bm/output.txt
36
- - bm/Rakefile
37
- - bm/tasks.rb
38
- - CHANGELOG
39
- - examples/arguments.rb
40
- - examples/basic.rb
41
- - examples/boot.rb
42
- - examples/complex.rb
43
- - examples/configuration.rb
44
- - examples/default.rb
33
+ - deps.rb
45
34
  - examples/default_proc.rb
46
- - examples/dependencies.rb
35
+ - examples/description.rb
36
+ - examples/default.rb
47
37
  - examples/file.rb
48
- - examples/helpers.rb
49
38
  - examples/invoking.rb
50
- - examples/script.rb
39
+ - examples/helpers.rb
40
+ - examples/configuration.rb
41
+ - examples/arguments.rb
51
42
  - examples/task_arguments.rb
52
- - features/arguments.feature
53
- - features/basic.feature
54
- - features/boot.feature
55
- - features/builtin_arguments.feature
43
+ - examples/dependencies.rb
44
+ - examples/boot.rb
45
+ - examples/rules.rb
46
+ - examples/script.rb
47
+ - examples/basic.rb
48
+ - examples/complex.rb
49
+ - CHANGELOG
50
+ - deps.rip
51
+ - features/task_arguments.feature
56
52
  - features/complex.feature
57
- - features/configuration.feature
58
- - features/default.feature
53
+ - features/executable.feature
54
+ - features/invoking.feature
59
55
  - features/default_proc.feature
56
+ - features/file.feature
57
+ - features/rules.feature
58
+ - features/steps.rb
59
+ - features/arguments.feature
60
60
  - features/dependencies.feature
61
61
  - features/env.rb
62
- - features/executable.feature
63
- - features/file.feature
62
+ - features/configuration.feature
63
+ - features/basic.feature
64
64
  - features/helpers.feature
65
- - features/invoking.feature
65
+ - features/builtin_arguments.feature
66
+ - features/description.feature
67
+ - features/boot.feature
68
+ - features/default.feature
66
69
  - features/script.feature
67
- - features/steps.rb
68
- - features/task_arguments.feature
69
- - lib/nake/args.rb
70
+ - lib/nake.rb
71
+ - lib/nake/struct_hash.rb
72
+ - lib/nake/abstract_task.rb
70
73
  - lib/nake/argv.rb
74
+ - lib/nake/rule.rb
75
+ - lib/nake/args.rb
76
+ - lib/nake/template.rb
77
+ - lib/nake/task.rb
78
+ - lib/nake/helpers.rb
71
79
  - lib/nake/colors.rb
72
- - lib/nake/dsl.rb
73
80
  - lib/nake/file_task.rb
74
- - lib/nake/helpers.rb
75
- - lib/nake/task.rb
76
- - lib/nake/tasks/bundle.rb
77
- - lib/nake/tasks/clean.rb
81
+ - lib/nake/dsl.rb
78
82
  - lib/nake/tasks/gem.rb
79
- - lib/nake/tasks/release.rb
80
83
  - lib/nake/tasks/rip.rb
84
+ - lib/nake/tasks/clean.rb
81
85
  - lib/nake/tasks/spec.rb
82
- - lib/nake.rb
86
+ - lib/nake/tasks/bundle.rb
87
+ - lib/nake/tasks/release.rb
88
+ - lib/nake/rake.rb
83
89
  - LICENSE
84
- - nake.gemspec
85
- - nake.pre.gemspec
86
- - Rakefile
87
90
  - README.textile
88
- - spec/nake/argv_spec.rb
89
- - spec/nake/colors_spec.rb
91
+ - prerelease.log
92
+ - nake.pre.gemspec
93
+ - bm/tasks.rb
94
+ - bm/Rakefile
95
+ - bm/bms.rb
96
+ - bm/output.txt
97
+ - nake.gemspec
98
+ - tasks.rb
99
+ - bin/rake2nake
100
+ - bin/nake
101
+ - bin/nrake
102
+ - bin/snake
103
+ - TODO.txt
104
+ - spec/spec_helper.rb
105
+ - spec/nake/rule_spec.rb
106
+ - spec/nake/args_spec.rb
107
+ - spec/nake/rake_spec.rb
108
+ - spec/nake/tasks_spec.rb
90
109
  - spec/nake/dsl_spec.rb
91
- - spec/nake/file_task_spec.rb
92
- - spec/nake/helpers_spec.rb
93
110
  - spec/nake/task_spec.rb
111
+ - spec/nake/helpers_spec.rb
112
+ - spec/nake/file_task_spec.rb
113
+ - spec/nake/colors_spec.rb
114
+ - spec/nake/struct_hash_spec.rb
115
+ - spec/nake/tasks/release_spec.rb
94
116
  - spec/nake/tasks/bundle_spec.rb
95
- - spec/nake/tasks_spec.rb
117
+ - spec/nake/tasks/rip_spec.rb
118
+ - spec/nake/tasks/clean_spec.rb
119
+ - spec/nake/tasks/gem_spec.rb
120
+ - spec/nake/tasks/spec_spec.rb
121
+ - spec/nake/template_spec.rb
122
+ - spec/nake/argv_spec.rb
123
+ - spec/nake/abstract_task_spec.rb
124
+ - spec/stubs/database.yml.erb
125
+ - spec/stubs/database.yml.tt
96
126
  - spec/nake_spec.rb
97
127
  - spec/spec.opts
98
- - spec/spec_helper.rb
99
- - tasks.rb
100
- - TODO.txt
101
128
  has_rdoc: true
102
129
  homepage: http://github.com/botanicus/nake
103
130
  licenses: []
104
131
 
105
132
  post_install_message: |-
106
133
  === Changes in the last Nake ===
107
- - Added Task#boot method for setting some stuff after other tasks boot
134
+ - Thanks to Task#config=, the configuration can be shared between multiple tasks
135
+ - Reworked rule, added Rule class
136
+ - Added --coloring & --no-coloring options
108
137
  rdoc_options: []
109
138
 
110
139
  require_paths:
@@ -117,9 +146,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
146
  version:
118
147
  required_rubygems_version: !ruby/object:Gem::Requirement
119
148
  requirements:
120
- - - ">="
149
+ - - ">"
121
150
  - !ruby/object:Gem::Version
122
- version: "0"
151
+ version: 1.3.1
123
152
  version:
124
153
  requirements: []
125
154
 
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # encoding: utf-8
2
-
3
- # I know, Rake is piece of shift, unfortunately RunCodeRun.com requires it.
4
- # http://support.runcoderun.com/faqs/builds/how-do-i-run-rake-with-trace-enabled
5
- Rake.application.options.trace = true
6
-
7
- # default task for RunCodeRun.com
8
- task(:default) { exec "spec spec && cucumber features" }