rucola 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/ChangeLog +301 -0
  2. data/History.txt +51 -0
  3. data/Manifest.txt +12 -0
  4. data/README.txt +6 -7
  5. data/TODO +13 -8
  6. data/app_generators/rucola/rucola_generator.rb +1 -1
  7. data/app_generators/rucola/templates/app/controllers/application_controller.rb +2 -2
  8. data/app_generators/rucola/templates/test/controllers/test_application_controller.rb +22 -5
  9. data/app_generators/rucola/templates/test/test_helper.rb +3 -2
  10. data/config/hoe.rb +2 -2
  11. data/lib/autotest/discover.rb +9 -0
  12. data/lib/autotest/fail.png +0 -0
  13. data/lib/autotest/growl_images.rb +39 -0
  14. data/lib/autotest/pass.png +0 -0
  15. data/lib/autotest/rucola.rb +36 -0
  16. data/lib/autotest/sound.rb +52 -0
  17. data/lib/rucola/info_plist.rb +5 -0
  18. data/lib/rucola/initializer.rb +65 -113
  19. data/lib/rucola/nib.rb +2 -2
  20. data/lib/rucola/plugin.rb +57 -0
  21. data/lib/rucola/rucola_support/initialize_hooks.rb +7 -0
  22. data/lib/rucola/rucola_support/notifications/notifications.rb +67 -27
  23. data/lib/rucola/rucola_support/rc_app.rb +9 -0
  24. data/lib/rucola/tasks/main.rake +8 -4
  25. data/lib/rucola/tasks/xcode.rake +10 -6
  26. data/lib/rucola/test_helper.rb +14 -0
  27. data/lib/rucola/version.rb +1 -1
  28. data/lib/rucola/xcode.rb +11 -6
  29. data/rucola_generators/controller/controller_generator.rb +1 -1
  30. data/rucola_generators/controller/templates/test_controller_template.rb.erb +14 -5
  31. data/rucola_generators/document_model/document_model_generator.rb +3 -3
  32. data/rucola_generators/document_model/templates/test_document_model_template.rb.erb +18 -5
  33. data/rucola_generators/rucola_plugin/USAGE +6 -0
  34. data/rucola_generators/rucola_plugin/rucola_plugin_generator.rb +63 -0
  35. data/rucola_generators/rucola_plugin/templates/init.rb.erb +25 -0
  36. data/rucola_generators/window_controller/templates/test_window_controller_template.rb.erb +21 -5
  37. data/rucola_generators/window_controller/window_controller_generator.rb +1 -1
  38. data/test/test_document_model_generator.rb +8 -2
  39. data/test/test_info_plist.rb +4 -0
  40. data/test/test_initializer.rb +80 -0
  41. data/test/test_nib.rb +9 -0
  42. data/test/test_notifications.rb +38 -19
  43. data/test/test_plugin.rb +48 -0
  44. data/test/test_rc_app.rb +5 -0
  45. data/test/test_rucola_plugin_generator.rb +65 -0
  46. data/test/test_xcode.rb +3 -3
  47. data/website/index.html +49 -7
  48. data/website/index.txt +34 -4
  49. metadata +37 -2
@@ -12,6 +12,11 @@ describe 'Rucola::RCApp' do
12
12
  ::RUBYCOCOA_ROOT = Pathname.new(@root_path)
13
13
  end
14
14
 
15
+ it "should return the name of the application" do
16
+ OSX::NSDictionary.expects(:dictionaryWithContentsOfFile).returns({'CFBundleExecutable' => 'PhatApp'})
17
+ RCApp.app_name.should == 'PhatApp'
18
+ end
19
+
15
20
  it "should return the path to the current root dir" do
16
21
  RCApp.root_path.should == @root_path
17
22
  end
@@ -0,0 +1,65 @@
1
+ require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
2
+
3
+ class TestRucolaPluginGenerator < Test::Unit::TestCase
4
+ include RubiGen::GeneratorTestHelper
5
+
6
+ def setup
7
+ bare_setup
8
+ end
9
+
10
+ def teardown
11
+ bare_teardown
12
+ end
13
+
14
+ # Some generator-related assertions:
15
+ # assert_generated_file(name, &block) # block passed the file contents
16
+ # assert_directory_exists(name)
17
+ # assert_generated_class(name, &block)
18
+ # assert_generated_module(name, &block)
19
+ # assert_generated_test_for(name, &block)
20
+ # The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
21
+ # assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
22
+ #
23
+ # Other helper methods are:
24
+ # app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
25
+ # bare_setup - place this in setup method to create the APP_ROOT folder for each test
26
+ # bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
27
+
28
+ def test_generator_without_options
29
+ name = "my_plugin"
30
+ run_generator('rucola_plugin', [name], sources)
31
+ plugin_dir = 'vendor/plugins/my_plugin'
32
+ assert_directory_exists(plugin_dir)
33
+ assert_directory_exists("#{plugin_dir}/generators")
34
+ assert_directory_exists("#{plugin_dir}/lib")
35
+ assert_directory_exists("#{plugin_dir}/tasks")
36
+ assert_directory_exists("#{plugin_dir}/test")
37
+ assert_generated_file("#{plugin_dir}/init.rb") do |file|
38
+ assert_match /class MyPlugin \< Plugin/, file
39
+ end
40
+ end
41
+
42
+ def test_generator_with_spec_option
43
+ name = "my_plugin"
44
+ run_generator('rucola_plugin', [name], sources, :rspec => true)
45
+ plugin_dir = 'vendor/plugins/my_plugin'
46
+ assert_directory_exists(plugin_dir)
47
+ assert_directory_exists("#{plugin_dir}/generators")
48
+ assert_directory_exists("#{plugin_dir}/lib")
49
+ assert_directory_exists("#{plugin_dir}/tasks")
50
+ assert_directory_exists("#{plugin_dir}/spec")
51
+ assert_generated_file("#{plugin_dir}/init.rb") do |file|
52
+ assert_match /class MyPlugin \< Plugin/, file
53
+ end
54
+ end
55
+
56
+ private
57
+ def sources
58
+ [RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
59
+ ]
60
+ end
61
+
62
+ def generator_path
63
+ "rucola_generators"
64
+ end
65
+ end
@@ -16,13 +16,13 @@ describe 'Xcode' do
16
16
  @object_values = { 'isa' => 'PBXNativeTarget', 'name' => @name, 'buildPhases' => [] }.to_ns
17
17
  @object = [@object_id, @object_values]
18
18
  @data = { 'objects' => { @object_id => @object_values } }.to_ns
19
- OSX::NSDictionary.stubs(:dictionaryWithContentsOfFile).with(@data_path).returns(@data)
19
+ OSX::NSMutableDictionary.stubs(:dictionaryWithContentsOfFile).with(@data_path).returns(@data)
20
20
 
21
21
  @project = Xcode.new(@project_path)
22
22
  end
23
23
 
24
24
  it "should initialize" do
25
- OSX::NSDictionary.expects(:dictionaryWithContentsOfFile).with(@data_path).returns(@data)
25
+ OSX::NSMutableDictionary.expects(:dictionaryWithContentsOfFile).with(@data_path).returns(@data)
26
26
 
27
27
  project = Xcode.new(@project_path)
28
28
  project.project_path.to_s.should == @project_path
@@ -76,7 +76,7 @@ describe 'Xcode' do
76
76
  end
77
77
 
78
78
  it "should add an object to a copy build phase" do
79
- id, values = 'BUILD_PHASE_ID'.to_ns, { 'name' => 'some blah', 'files' => [] }.to_ns
79
+ id, values = 'BUILD_PHASE_ID'.to_ns, { 'name' => 'some blah', 'files' => [].to_ns }.to_ns
80
80
  @project.add_object(id, values)
81
81
  @project.add_build_phase_to_project_target(id)
82
82
 
@@ -33,14 +33,11 @@
33
33
  <h1>rucola</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/rucola"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/rucola" class="numbers">0.0.1</a>
36
+ <a href="http://rubyforge.org/projects/rucola" class="numbers">0.0.2</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;rucola&#8217;</h1>
39
39
 
40
40
 
41
- <h3><span class="caps">SUPER DUPER PRE ALPHA VERSION</span> (expect things to break kinda alpha&#8230;)</h3>
42
-
43
-
44
41
  <h2>What</h2>
45
42
 
46
43
 
@@ -57,16 +54,25 @@ and document-based applications. It also provides APIs for simplifying some of
57
54
  ways of doing things.</p>
58
55
 
59
56
 
57
+ <h2>Requirements</h2>
58
+
59
+
60
+ <ul>
61
+ <li><a href="http://sourceforge.net/project/showfiles.php?group_id=44114&#38;package_id=36578">RubyCocoa 0.13</a> That&#8217;s <span class="caps">NOT</span> the one included with Leopard, which is 0.12</li>
62
+ <li>For testing it&#8217;s adviced to install the following gems: test-spec, mocha, zentest (autotest)</li>
63
+ </ul>
64
+
65
+
60
66
  <h2>Installing</h2>
61
67
 
62
68
 
63
- <p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">rucola</span></pre></p>
69
+ <p><pre class='syntax'>sudo gem install rucola</pre></p>
64
70
 
65
71
 
66
72
  <h2>Demonstration of usage</h2>
67
73
 
68
74
 
69
- <h4>Generating an application skeleton</h4>
75
+ <h3>Generating an application skeleton</h3>
70
76
 
71
77
 
72
78
  <pre><code>rucola MyApp -a "Your Name"</code></pre>
@@ -162,6 +168,42 @@ After you&#8217;ve added this, you can run `rake ib:update` and your outlet will
162
168
  you can now hook up to your UI button.</p>
163
169
 
164
170
 
171
+ <h2>Extras</h2>
172
+
173
+
174
+ <p>Sample apps can be found at:</p>
175
+
176
+
177
+ <p><pre class='syntax'> svn co svn://rubyforge.org/var/svn/rucola/extras/examples/</pre></p>
178
+
179
+
180
+ <p>There&#8217;s a basic TextMate bundle which contains only 4 commands which are the equivalent of the &#8220;go to file&#8221; commands in the rails bundle. With these going from a controller to it&#8217;s test/model/view file is only a shortcut away. To get it:</p>
181
+
182
+
183
+ <p><pre class='syntax'>
184
+ cd ~/Library/Application\ Support/TextMate/Bundles/
185
+ svn co svn://rubyforge.org/var/svn/rucola/extras/Rucola.tmbundle
186
+ </pre></p>
187
+
188
+
189
+ <p>There&#8217;s a crash reporter plugin and a ActiveRecord plugin available. Check their descriptions with:</p>
190
+
191
+
192
+ <p><pre class='syntax'>
193
+ cd MyApp
194
+ script/plugin list
195
+ </pre></p>
196
+
197
+
198
+ <p>Or install them with:</p>
199
+
200
+
201
+ <p><pre class='syntax'>
202
+ cd MyApp
203
+ script/plugin install SACrashReporter
204
+ </pre></p>
205
+
206
+
165
207
  <h2>Forum</h2>
166
208
 
167
209
 
@@ -188,7 +230,7 @@ you can now hook up to your UI button.</p>
188
230
 
189
231
  <p>Comments are welcome. Send an email via the <a href="http://groups.google.com/group/rucola">forum</a></p>
190
232
  <p class="coda">
191
- <a href="http://groups.google.com/group/rucola">Eloy Duran, Justin Palmer</a>, 3rd November 2007<br>
233
+ <a href="http://groups.google.com/group/rucola">Eloy Duran, Justin Palmer</a>, 26th November 2007<br>
192
234
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
193
235
  </p>
194
236
  </div>
@@ -2,8 +2,6 @@ h1. rucola
2
2
 
3
3
  h1. &#x2192; 'rucola'
4
4
 
5
- h3. SUPER DUPER PRE ALPHA VERSION (expect things to break kinda alpha...)
6
-
7
5
  h2. What
8
6
 
9
7
  A Framework for building Cocoa applications in Ruby
@@ -16,13 +14,18 @@ Rucola provides a set of generators to help you generate controllers, window con
16
14
  and document-based applications. It also provides APIs for simplifying some of Objective-C's
17
15
  ways of doing things.
18
16
 
17
+ h2. Requirements
18
+
19
+ * "RubyCocoa 0.13":http://sourceforge.net/project/showfiles.php?group_id=44114&package_id=36578 That's NOT the one included with Leopard, which is 0.12
20
+ * For testing it's adviced to install the following gems: test-spec, mocha, zentest (autotest)
21
+
19
22
  h2. Installing
20
23
 
21
- <pre syntax="ruby">sudo gem install rucola</pre>
24
+ <pre syntax="sh">sudo gem install rucola</pre>
22
25
 
23
26
  h2. Demonstration of usage
24
27
 
25
- h4. Generating an application skeleton
28
+ h3. Generating an application skeleton
26
29
 
27
30
  rucola MyApp -a "Your Name"
28
31
 
@@ -106,6 +109,33 @@ For example, if we wanted to add a button to the application controller above, w
106
109
  After you've added this, you can run `rake ib:update` and your outlet will be available in interface builder that
107
110
  you can now hook up to your UI button.
108
111
 
112
+ h2. Extras
113
+
114
+ Sample apps can be found at:
115
+
116
+ <pre syntax="sh"> svn co svn://rubyforge.org/var/svn/rucola/extras/examples/</pre>
117
+
118
+ There's a basic TextMate bundle which contains only 4 commands which are the equivalent of the "go to file" commands in the rails bundle. With these going from a controller to it's test/model/view file is only a shortcut away. To get it:
119
+
120
+ <pre syntax="sh">
121
+ cd ~/Library/Application\ Support/TextMate/Bundles/
122
+ svn co svn://rubyforge.org/var/svn/rucola/extras/Rucola.tmbundle
123
+ </pre>
124
+
125
+ There's a crash reporter plugin and a ActiveRecord plugin available. Check their descriptions with:
126
+
127
+ <pre syntax="sh">
128
+ cd MyApp
129
+ script/plugin list
130
+ </pre>
131
+
132
+ Or install them with:
133
+
134
+ <pre syntax="sh">
135
+ cd MyApp
136
+ script/plugin install SACrashReporter
137
+ </pre>
138
+
109
139
  h2. Forum
110
140
 
111
141
  "http://groups.google.com/group/rucola":http://groups.google.com/group/rucola
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: rucola
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2007-11-03 00:00:00 +01:00
6
+ version: 0.0.2
7
+ date: 2007-11-26 00:00:00 +01:00
8
8
  summary: Rucola is an extension for RubyCocoa. It has a application skeleton generator and builds an "opinionated" application layout, like the one known from rails. And comes with RubyCocoa specific rake tasks.
9
9
  require_paths:
10
10
  - lib
@@ -29,6 +29,8 @@ post_install_message:
29
29
  authors:
30
30
  - Eloy Duran
31
31
  - Justin Palmer
32
+ - Chris McGrath
33
+ - Satoshi Nagakawa
32
34
  files:
33
35
  - ChangeLog
34
36
  - History.txt
@@ -62,10 +64,17 @@ files:
62
64
  - bin/rucola
63
65
  - config/hoe.rb
64
66
  - config/requirements.rb
67
+ - lib/autotest/discover.rb
68
+ - lib/autotest/fail.png
69
+ - lib/autotest/growl_images.rb
70
+ - lib/autotest/pass.png
71
+ - lib/autotest/rucola.rb
72
+ - lib/autotest/sound.rb
65
73
  - lib/rucola.rb
66
74
  - lib/rucola/info_plist.rb
67
75
  - lib/rucola/initializer.rb
68
76
  - lib/rucola/nib.rb
77
+ - lib/rucola/plugin.rb
69
78
  - lib/rucola/rucola_support.rb
70
79
  - lib/rucola/rucola_support/controllers.rb
71
80
  - lib/rucola/rucola_support/controllers/rc_controller.rb
@@ -97,6 +106,9 @@ files:
97
106
  - rucola_generators/document_model/document_model_generator.rb
98
107
  - rucola_generators/document_model/templates/document_model_template.rb.erb
99
108
  - rucola_generators/document_model/templates/test_document_model_template.rb.erb
109
+ - rucola_generators/rucola_plugin/USAGE
110
+ - rucola_generators/rucola_plugin/rucola_plugin_generator.rb
111
+ - rucola_generators/rucola_plugin/templates/init.rb.erb
100
112
  - rucola_generators/window_controller/USAGE
101
113
  - rucola_generators/window_controller/templates/Window.nib/classes.nib.erb
102
114
  - rucola_generators/window_controller/templates/Window.nib/info.nib
@@ -124,11 +136,13 @@ files:
124
136
  - test/test_nib.rb
125
137
  - test/test_notifications.rb
126
138
  - test/test_objc_core_ext.rb
139
+ - test/test_plugin.rb
127
140
  - test/test_rc_app.rb
128
141
  - test/test_rc_document.rb
129
142
  - test/test_rc_window_controller.rb
130
143
  - test/test_rucola.rb
131
144
  - test/test_rucola_generator.rb
145
+ - test/test_rucola_plugin_generator.rb
132
146
  - test/test_window_controller_generator.rb
133
147
  - test/test_xcode.rb
134
148
  - website/index.html
@@ -143,14 +157,17 @@ test_files:
143
157
  - test/test_generator_helper.rb
144
158
  - test/test_helper.rb
145
159
  - test/test_info_plist.rb
160
+ - test/test_initializer.rb
146
161
  - test/test_nib.rb
147
162
  - test/test_notifications.rb
148
163
  - test/test_objc_core_ext.rb
164
+ - test/test_plugin.rb
149
165
  - test/test_rc_app.rb
150
166
  - test/test_rc_document.rb
151
167
  - test/test_rc_window_controller.rb
152
168
  - test/test_rucola.rb
153
169
  - test/test_rucola_generator.rb
170
+ - test/test_rucola_plugin_generator.rb
154
171
  - test/test_window_controller_generator.rb
155
172
  - test/test_xcode.rb
156
173
  rdoc_options:
@@ -187,3 +204,21 @@ dependencies:
187
204
  - !ruby/object:Gem::Version
188
205
  version: 0.0.0
189
206
  version:
207
+ - !ruby/object:Gem::Dependency
208
+ name: test-spec
209
+ version_requirement:
210
+ version_requirements: !ruby/object:Gem::Version::Requirement
211
+ requirements:
212
+ - - ">"
213
+ - !ruby/object:Gem::Version
214
+ version: 0.0.0
215
+ version:
216
+ - !ruby/object:Gem::Dependency
217
+ name: mocha
218
+ version_requirement:
219
+ version_requirements: !ruby/object:Gem::Version::Requirement
220
+ requirements:
221
+ - - ">"
222
+ - !ruby/object:Gem::Version
223
+ version: 0.0.0
224
+ version: