randomizer 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +0,0 @@
1
- === 0.0.1 2009-08-11
2
-
3
- * 1 major enhancement:
4
- * Initial release
@@ -1,18 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- PostInstall.txt
4
- README.rdoc
5
- Rakefile
6
- features/development.feature
7
- features/step_definitions/common_steps.rb
8
- features/support/common.rb
9
- features/support/env.rb
10
- features/support/matchers.rb
11
- lib/randomizer.rb
12
- script/console
13
- script/destroy
14
- script/generate
15
- spec/randomizer_spec.rb
16
- spec/spec.opts
17
- spec/spec_helper.rb
18
- tasks/rspec.rake
@@ -1,7 +0,0 @@
1
-
2
- For more information on randomizer, see http://randomizer.rubyforge.org
3
-
4
- NOTE: Change this information in PostInstall.txt
5
- You can also delete it if you don't want it.
6
-
7
-
@@ -1,13 +0,0 @@
1
- Feature: Development processes of newgem itself (rake tasks)
2
-
3
- As a Newgem maintainer or contributor
4
- I want rake tasks to maintain and release the gem
5
- So that I can spend time on the tests and code, and not excessive time on maintenance processes
6
-
7
- Scenario: Generate RubyGem
8
- Given this project is active project folder
9
- And "pkg" folder is deleted
10
- When I invoke task "rake gem"
11
- Then folder "pkg" is created
12
- And file with name matching "pkg/*.gem" is created else you should run "rake manifest" to fix this
13
- And gem spec key "rdoc_options" contains /--mainREADME.rdoc/
@@ -1,163 +0,0 @@
1
- Given /^this project is active project folder/ do
2
- @active_project_folder = File.expand_path(File.dirname(__FILE__) + "/../..")
3
- end
4
-
5
- Given /^env variable \$([\w_]+) set to "(.*)"/ do |env_var, value|
6
- ENV[env_var] = value
7
- end
8
-
9
- Given /"(.*)" folder is deleted/ do |folder|
10
- in_project_folder { FileUtils.rm_rf folder }
11
- end
12
-
13
- When /^I invoke "(.*)" generator with arguments "(.*)"$/ do |generator, arguments|
14
- @stdout = StringIO.new
15
- in_project_folder do
16
- if Object.const_defined?("APP_ROOT")
17
- APP_ROOT.replace(FileUtils.pwd)
18
- else
19
- APP_ROOT = FileUtils.pwd
20
- end
21
- run_generator(generator, arguments.split(' '), SOURCES, :stdout => @stdout)
22
- end
23
- File.open(File.join(@tmp_root, "generator.out"), "w") do |f|
24
- @stdout.rewind
25
- f << @stdout.read
26
- end
27
- end
28
-
29
- When /^I run executable "(.*)" with arguments "(.*)"/ do |executable, arguments|
30
- @stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
31
- in_project_folder do
32
- system "#{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
33
- end
34
- end
35
-
36
- When /^I run project executable "(.*)" with arguments "(.*)"/ do |executable, arguments|
37
- @stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
38
- in_project_folder do
39
- system "ruby #{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
40
- end
41
- end
42
-
43
- When /^I run local executable "(.*)" with arguments "(.*)"/ do |executable, arguments|
44
- @stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
45
- executable = File.expand_path(File.join(File.dirname(__FILE__), "/../../bin", executable))
46
- in_project_folder do
47
- system "ruby #{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
48
- end
49
- end
50
-
51
- When /^I invoke task "rake (.*)"/ do |task|
52
- @stdout = File.expand_path(File.join(@tmp_root, "tests.out"))
53
- in_project_folder do
54
- system "rake #{task} --trace > #{@stdout} 2> #{@stdout}"
55
- end
56
- end
57
-
58
- Then /^folder "(.*)" (is|is not) created/ do |folder, is|
59
- in_project_folder do
60
- File.exists?(folder).should(is == 'is' ? be_true : be_false)
61
- end
62
- end
63
-
64
- Then /^file "(.*)" (is|is not) created/ do |file, is|
65
- in_project_folder do
66
- File.exists?(file).should(is == 'is' ? be_true : be_false)
67
- end
68
- end
69
-
70
- Then /^file with name matching "(.*)" is created/ do |pattern|
71
- in_project_folder do
72
- Dir[pattern].should_not be_empty
73
- end
74
- end
75
-
76
- Then /^file "(.*)" contents (does|does not) match \/(.*)\// do |file, does, regex|
77
- in_project_folder do
78
- actual_output = File.read(file)
79
- (does == 'does') ?
80
- actual_output.should(match(/#{regex}/)) :
81
- actual_output.should_not(match(/#{regex}/))
82
- end
83
- end
84
-
85
- Then /gem file "(.*)" and generated file "(.*)" should be the same/ do |gem_file, project_file|
86
- File.exists?(gem_file).should be_true
87
- File.exists?(project_file).should be_true
88
- gem_file_contents = File.read(File.dirname(__FILE__) + "/../../#{gem_file}")
89
- project_file_contents = File.read(File.join(@active_project_folder, project_file))
90
- project_file_contents.should == gem_file_contents
91
- end
92
-
93
- Then /^(does|does not) invoke generator "(.*)"$/ do |does_invoke, generator|
94
- actual_output = File.read(@stdout)
95
- does_invoke == "does" ?
96
- actual_output.should(match(/dependency\s+#{generator}/)) :
97
- actual_output.should_not(match(/dependency\s+#{generator}/))
98
- end
99
-
100
- Then /help options "(.*)" and "(.*)" are displayed/ do |opt1, opt2|
101
- actual_output = File.read(@stdout)
102
- actual_output.should match(/#{opt1}/)
103
- actual_output.should match(/#{opt2}/)
104
- end
105
-
106
- Then /^I should see$/ do |text|
107
- actual_output = File.read(@stdout)
108
- actual_output.should contain(text)
109
- end
110
-
111
- Then /^I should not see$/ do |text|
112
- actual_output = File.read(@stdout)
113
- actual_output.should_not contain(text)
114
- end
115
-
116
- Then /^I should see exactly$/ do |text|
117
- actual_output = File.read(@stdout)
118
- actual_output.should == text
119
- end
120
-
121
- Then /^I should see all (\d+) tests pass/ do |expected_test_count|
122
- expected = %r{^#{expected_test_count} tests, \d+ assertions, 0 failures, 0 errors}
123
- actual_output = File.read(@stdout)
124
- actual_output.should match(expected)
125
- end
126
-
127
- Then /^I should see all (\d+) examples pass/ do |expected_test_count|
128
- expected = %r{^#{expected_test_count} examples?, 0 failures}
129
- actual_output = File.read(@stdout)
130
- actual_output.should match(expected)
131
- end
132
-
133
- Then /^yaml file "(.*)" contains (\{.*\})/ do |file, yaml|
134
- in_project_folder do
135
- yaml = eval yaml
136
- YAML.load(File.read(file)).should == yaml
137
- end
138
- end
139
-
140
- Then /^Rakefile can display tasks successfully/ do
141
- @stdout = File.expand_path(File.join(@tmp_root, "rakefile.out"))
142
- in_project_folder do
143
- system "rake -T > #{@stdout} 2> #{@stdout}"
144
- end
145
- actual_output = File.read(@stdout)
146
- actual_output.should match(/^rake\s+\w+\s+#\s.*/)
147
- end
148
-
149
- Then /^task "rake (.*)" is executed successfully/ do |task|
150
- @stdout.should_not be_nil
151
- actual_output = File.read(@stdout)
152
- actual_output.should_not match(/^Don't know how to build task '#{task}'/)
153
- actual_output.should_not match(/Error/i)
154
- end
155
-
156
- Then /^gem spec key "(.*)" contains \/(.*)\// do |key, regex|
157
- in_project_folder do
158
- gem_file = Dir["pkg/*.gem"].first
159
- gem_spec = Gem::Specification.from_yaml(`gem spec #{gem_file}`)
160
- spec_value = gem_spec.send(key.to_sym)
161
- spec_value.to_s.should match(/#{regex}/)
162
- end
163
- end
@@ -1,29 +0,0 @@
1
- module CommonHelpers
2
- def in_tmp_folder(&block)
3
- FileUtils.chdir(@tmp_root, &block)
4
- end
5
-
6
- def in_project_folder(&block)
7
- project_folder = @active_project_folder || @tmp_root
8
- FileUtils.chdir(project_folder, &block)
9
- end
10
-
11
- def in_home_folder(&block)
12
- FileUtils.chdir(@home_path, &block)
13
- end
14
-
15
- def force_local_lib_override(project_name = @project_name)
16
- rakefile = File.read(File.join(project_name, 'Rakefile'))
17
- File.open(File.join(project_name, 'Rakefile'), "w+") do |f|
18
- f << "$:.unshift('#{@lib_path}')\n"
19
- f << rakefile
20
- end
21
- end
22
-
23
- def setup_active_project_folder project_name
24
- @active_project_folder = File.join(@tmp_root, project_name)
25
- @project_name = project_name
26
- end
27
- end
28
-
29
- World(CommonHelpers)
@@ -1,11 +0,0 @@
1
- module Matchers
2
- def contain(expected)
3
- simple_matcher("contain #{expected.inspect}") do |given, matcher|
4
- matcher.failure_message = "expected #{given.inspect} to contain #{expected.inspect}"
5
- matcher.negative_failure_message = "expected #{given.inspect} not to contain #{expected.inspect}"
6
- given.index expected
7
- end
8
- end
9
- end
10
-
11
- World(Matchers)
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # File: script/console
3
- irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
-
5
- libs = " -r irb/completion"
6
- # Perhaps use a console_lib to store any extra methods I may want available in the console
7
- # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/randomizer.rb'}"
9
- puts "Loading randomizer gem"
10
- exec "#{irb} #{libs} --simple-prompt"
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)
@@ -1,21 +0,0 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems' unless ENV['NO_RUBYGEMS']
5
- require 'spec'
6
- end
7
- begin
8
- require 'spec/rake/spectask'
9
- rescue LoadError
10
- puts <<-EOS
11
- To use rspec for testing you must install rspec gem:
12
- gem install rspec
13
- EOS
14
- exit(0)
15
- end
16
-
17
- desc "Run the specs under spec/models"
18
- Spec::Rake::SpecTask.new do |t|
19
- t.spec_opts = ['--options', "spec/spec.opts"]
20
- t.spec_files = FileList['spec/**/*_spec.rb']
21
- end