cans 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,44 @@
1
+ describe 'Module', ->
2
+ it 'should take a name when constructed', ->
3
+ module = new Module('SampleModule')
4
+ expect(module.name).toEqual 'SampleModule'
5
+
6
+ describe 'instance', ->
7
+
8
+ module = null
9
+
10
+ beforeEach ->
11
+ module = new Module('SampleModule')
12
+ view =
13
+ trigger: (name) ->
14
+ null
15
+ spyOn view, 'trigger'
16
+ module.view = view
17
+
18
+ it 'should Ajax fetch when asked to load', ->
19
+ spyOn jQuery, 'ajax'
20
+ module.load()
21
+ expect(jQuery.ajax).toHaveBeenCalled()
22
+
23
+ it 'should consume ajax data', ->
24
+ data =
25
+ child_modules: ['SampleModule::Client']
26
+ class_methods: ['locate_a_client']
27
+ local_instance_methods: ['be_a_sample']
28
+ inherited_instance_methods: ['be_an_object']
29
+ module.consume(data)
30
+ expect(module.childModules).toEqual([new Module('SampleModule::Client')])
31
+ expect(module.classMethods).toEqual([new ClassMethod(module, 'locate_a_client')])
32
+ expect(module.localInstanceMethods).toEqual([new InstanceMethod(module, 'be_a_sample')])
33
+ expect(module.inheritedInstanceMethods).toEqual([new InstanceMethod(module, 'be_an_object')])
34
+ describe 'consuming Ajax data', ->
35
+ beforeEach ->
36
+ data =
37
+ child_modules: ['SampleModule::Client']
38
+ class_methods: ['locate_a_client']
39
+ local_instance_methods: ['be_a_sample']
40
+ inherited_instance_methods: ['be_an_object']
41
+ module.consume(data)
42
+
43
+ it 'should notify the view that it loaded', ->
44
+ expect(module.view.trigger).toHaveBeenCalledWith('loaded')
@@ -0,0 +1,10 @@
1
+ require('/json2.js');
2
+ require('/jquery-1.4.4.min.js');
3
+ require('/underscore-min.js');
4
+ require('/backbone-min.js');
5
+ require('/shCore.js');
6
+ require('/shBrushRuby.js');
7
+
8
+ document.write("<div id='module_template'> \n</div> \n<div id='method_template'> \n</div>\n<div id='source_template'>\n</div>\n<div id='source_error_template'>\n</div>");
9
+
10
+ require('/application.js');
@@ -0,0 +1,73 @@
1
+ # src_files
2
+ #
3
+ # Return an array of filepaths relative to src_dir to include before jasmine specs.
4
+ # Default: []
5
+ #
6
+ # EXAMPLE:
7
+ #
8
+ # src_files:
9
+ # - lib/source1.js
10
+ # - lib/source2.js
11
+ # - dist/**/*.js
12
+ #
13
+ src_files:
14
+ - public/javascripts/**/*.js
15
+
16
+ # stylesheets
17
+ #
18
+ # Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
19
+ # Default: []
20
+ #
21
+ # EXAMPLE:
22
+ #
23
+ # stylesheets:
24
+ # - css/style.css
25
+ # - stylesheets/*.css
26
+ #
27
+ stylesheets:
28
+
29
+ # helpers
30
+ #
31
+ # Return an array of filepaths relative to spec_dir to include before jasmine specs.
32
+ # Default: ["helpers/**/*.js"]
33
+ #
34
+ # EXAMPLE:
35
+ #
36
+ # helpers:
37
+ # - helpers/**/*.js
38
+ #
39
+ helpers:
40
+
41
+ # spec_files
42
+ #
43
+ # Return an array of filepaths relative to spec_dir to include.
44
+ # Default: ["**/*[sS]pec.js"]
45
+ #
46
+ # EXAMPLE:
47
+ #
48
+ # spec_files:
49
+ # - **/*[sS]pec.js
50
+ #
51
+ spec_files:
52
+
53
+ # src_dir
54
+ #
55
+ # Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
56
+ # Default: project root
57
+ #
58
+ # EXAMPLE:
59
+ #
60
+ # src_dir: public
61
+ #
62
+ src_dir:
63
+
64
+ # spec_dir
65
+ #
66
+ # Spec directory path. Your spec_files must be returned relative to this path.
67
+ # Default: spec/javascripts
68
+ #
69
+ # EXAMPLE:
70
+ #
71
+ # spec_dir: spec/javascripts
72
+ #
73
+ spec_dir:
@@ -0,0 +1,32 @@
1
+ $:.unshift(ENV['JASMINE_GEM_PATH']) if ENV['JASMINE_GEM_PATH'] # for gem testing purposes
2
+
3
+ require 'rubygems'
4
+ require 'jasmine'
5
+ jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config.rb'))
6
+ require jasmine_config_overrides if File.exist?(jasmine_config_overrides)
7
+ if Jasmine::rspec2?
8
+ require 'rspec'
9
+ else
10
+ require 'spec'
11
+ end
12
+
13
+ jasmine_config = Jasmine::Config.new
14
+ spec_builder = Jasmine::SpecBuilder.new(jasmine_config)
15
+
16
+ should_stop = false
17
+
18
+ if Jasmine::rspec2?
19
+ RSpec.configuration.after(:suite) do
20
+ spec_builder.stop if should_stop
21
+ end
22
+ else
23
+ Spec::Runner.configure do |config|
24
+ config.after(:suite) do
25
+ spec_builder.stop if should_stop
26
+ end
27
+ end
28
+ end
29
+
30
+ spec_builder.start
31
+ should_stop = true
32
+ spec_builder.declare_suites
@@ -0,0 +1,8 @@
1
+ <div id='module_template'>
2
+ </div>
3
+ <div id='method_template'>
4
+ </div>
5
+ <div id='source_template'>
6
+ </div>
7
+ <div id='source_error_template'>
8
+ </div>
data/tmp/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ restart.txt
2
+ always_restart.txt
3
+
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
7
  - 2
9
- version: 0.1.2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Bryce Kerley
@@ -14,12 +14,11 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-12 00:00:00 -06:00
17
+ date: 2011-05-19 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: sinatra
22
- prerelease: false
23
22
  requirement: &id001 !ruby/object:Gem::Requirement
24
23
  none: false
25
24
  requirements:
@@ -31,10 +30,10 @@ dependencies:
31
30
  - 0
32
31
  version: 1.1.0
33
32
  type: :runtime
33
+ prerelease: false
34
34
  version_requirements: *id001
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: haml
37
- prerelease: false
38
37
  requirement: &id002 !ruby/object:Gem::Requirement
39
38
  none: false
40
39
  requirements:
@@ -46,10 +45,10 @@ dependencies:
46
45
  - 22
47
46
  version: 3.0.22
48
47
  type: :runtime
48
+ prerelease: false
49
49
  version_requirements: *id002
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: method_extensions
52
- prerelease: false
53
52
  requirement: &id003 !ruby/object:Gem::Requirement
54
53
  none: false
55
54
  requirements:
@@ -61,10 +60,10 @@ dependencies:
61
60
  - 8
62
61
  version: 0.0.8
63
62
  type: :runtime
63
+ prerelease: false
64
64
  version_requirements: *id003
65
65
  - !ruby/object:Gem::Dependency
66
66
  name: shoulda
67
- prerelease: false
68
67
  requirement: &id004 !ruby/object:Gem::Requirement
69
68
  none: false
70
69
  requirements:
@@ -76,10 +75,10 @@ dependencies:
76
75
  - 3
77
76
  version: 2.11.3
78
77
  type: :development
78
+ prerelease: false
79
79
  version_requirements: *id004
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rack-test
82
- prerelease: false
83
82
  requirement: &id005 !ruby/object:Gem::Requirement
84
83
  none: false
85
84
  requirements:
@@ -91,22 +90,53 @@ dependencies:
91
90
  - 6
92
91
  version: 0.5.6
93
92
  type: :development
93
+ prerelease: false
94
94
  version_requirements: *id005
95
95
  - !ruby/object:Gem::Dependency
96
- name: mocha
97
- prerelease: false
96
+ name: coffee-script
98
97
  requirement: &id006 !ruby/object:Gem::Requirement
99
98
  none: false
100
99
  requirements:
101
100
  - - ~>
102
101
  - !ruby/object:Gem::Version
103
102
  segments:
103
+ - 1
104
+ - 1
104
105
  - 0
105
- - 9
106
- - 9
107
- version: 0.9.9
106
+ version: 1.1.0
108
107
  type: :development
108
+ prerelease: false
109
109
  version_requirements: *id006
110
+ - !ruby/object:Gem::Dependency
111
+ name: evergreen
112
+ requirement: &id007 !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ segments:
118
+ - 0
119
+ - 4
120
+ - 0
121
+ version: 0.4.0
122
+ type: :development
123
+ prerelease: false
124
+ version_requirements: *id007
125
+ - !ruby/object:Gem::Dependency
126
+ name: mocha
127
+ requirement: &id008 !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ~>
131
+ - !ruby/object:Gem::Version
132
+ segments:
133
+ - 0
134
+ - 9
135
+ - 12
136
+ version: 0.9.12
137
+ type: :development
138
+ prerelease: false
139
+ version_requirements: *id008
110
140
  description: Interactive on-line source browser for rack applications
111
141
  email: bkerley@brycekerley.net
112
142
  executables: []
@@ -120,26 +150,47 @@ files:
120
150
  - .document
121
151
  - .gitignore
122
152
  - Gemfile
123
- - Gemfile.lock
124
153
  - LICENSE
125
154
  - README.rdoc
126
155
  - Rakefile
127
- - VERSION
128
156
  - cans.gemspec
129
157
  - config.ru
158
+ - config/evergreen.rb
130
159
  - lib/cans.rb
131
160
  - lib/cans/address.rb
132
161
  - lib/cans/application.rb
133
162
  - lib/cans/historian.rb
163
+ - lib/cans/static/application.js
164
+ - lib/cans/static/backbone-min.js
165
+ - lib/cans/static/frameset.css
166
+ - lib/cans/static/jquery-1.4.4.min.js
167
+ - lib/cans/static/json2.js
168
+ - lib/cans/static/shBrushRuby.js
169
+ - lib/cans/static/shCore.js
170
+ - lib/cans/static/shCoreMidnight.css
171
+ - lib/cans/static/underscore-min.js
172
+ - lib/cans/version.rb
173
+ - lib/cans/views/application.coffee
174
+ - lib/cans/views/frameset.haml
134
175
  - lib/cans/views/index.haml
135
176
  - lib/cans/views/method.haml
136
177
  - lib/cans/views/module.haml
178
+ - spec/javascripts/instance_method_spec.coffee
179
+ - spec/javascripts/machine_spec.coffee
180
+ - spec/javascripts/machine_view_spec.coffee
181
+ - spec/javascripts/method_spec.coffee
182
+ - spec/javascripts/module_spec.coffee
183
+ - spec/javascripts/spec_helper.js
184
+ - spec/javascripts/support/jasmine.yml
185
+ - spec/javascripts/support/jasmine_runner.rb
186
+ - spec/javascripts/templates/view_templates.html
137
187
  - test/fixtures/beverage.rb
138
188
  - test/helper.rb
139
189
  - test/test_address.rb
140
190
  - test/test_application.rb
141
191
  - test/test_cans.rb
142
192
  - test/test_historian.rb
193
+ - tmp/.gitignore
143
194
  has_rdoc: true
144
195
  homepage: http://github.com/bkerley/cans
145
196
  licenses: []
@@ -175,6 +226,15 @@ signing_key:
175
226
  specification_version: 3
176
227
  summary: Source browser for Rack applications
177
228
  test_files:
229
+ - spec/javascripts/instance_method_spec.coffee
230
+ - spec/javascripts/machine_spec.coffee
231
+ - spec/javascripts/machine_view_spec.coffee
232
+ - spec/javascripts/method_spec.coffee
233
+ - spec/javascripts/module_spec.coffee
234
+ - spec/javascripts/spec_helper.js
235
+ - spec/javascripts/support/jasmine.yml
236
+ - spec/javascripts/support/jasmine_runner.rb
237
+ - spec/javascripts/templates/view_templates.html
178
238
  - test/fixtures/beverage.rb
179
239
  - test/helper.rb
180
240
  - test/test_address.rb
data/Gemfile.lock DELETED
@@ -1,38 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- cans (0.1.1)
5
- haml (~> 3.0.22)
6
- method_extensions (~> 0.0.8)
7
- sinatra (~> 1.1.0)
8
-
9
- GEM
10
- remote: http://rubygems.org/
11
- specs:
12
- coderay (0.9.3)
13
- haml (3.0.23)
14
- method_extensions (0.0.8)
15
- coderay (= 0.9.3)
16
- mocha (0.9.9)
17
- rake
18
- rack (1.2.1)
19
- rack-test (0.5.6)
20
- rack (>= 1.0)
21
- rake (0.8.7)
22
- shoulda (2.11.3)
23
- sinatra (1.1.0)
24
- rack (~> 1.1)
25
- tilt (~> 1.1)
26
- tilt (1.1)
27
-
28
- PLATFORMS
29
- ruby
30
-
31
- DEPENDENCIES
32
- cans!
33
- haml (~> 3.0.22)
34
- method_extensions (~> 0.0.8)
35
- mocha (~> 0.9.9)
36
- rack-test (~> 0.5.6)
37
- shoulda (~> 2.11.3)
38
- sinatra (~> 1.1.0)
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.2