jasmine-rails 0.5.1 → 0.5.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.
data/README.md CHANGED
@@ -27,53 +27,30 @@ First, add jasmine-rails to your Gemfile, like so
27
27
  gem 'jasmine-rails'
28
28
  end
29
29
 
30
- Next, run `bundle install`.
30
+ Next:
31
31
 
32
- Now, just mount jasmine-rails into your application by adding something like this to your routes.rb. The engine can be mounted to any path that you choose.
33
-
34
- ``` ruby
35
- mount JasmineRails::Engine => "/specs" if defined?(JasmineRails)
32
+ ```
33
+ $ bundle install
36
34
  ```
37
35
 
38
- ## Configuration
39
-
40
- In order to run any specs, you'll need a Jasmine configuration in `spec/javascripts/support/jasmine.yml`. [Here's an example](https://github.com/searls/jasmine-rails/tree/master/spec/javascripts/support) from this repo's [dummy project](https://github.com/searls/jasmine-rails/tree/master/spec/dummy).
41
-
42
- ``` yaml
43
- # path to parent directory of src_files
44
- # relative path from Rails.root
45
- # defaults to app/assets/javascripts
46
- src_dir: "app/assets/javascripts"
47
-
48
- # list of file expressions to include as source files
49
- # relative path from src_dir
50
- src_files:
51
- - "application.{js,coffee}"
36
+ And finally, run the Rails generator:
52
37
 
53
- # path to parent directory of spec_files
54
- # relative path from Rails.root
55
- # defaults to spec/javascripts
56
- spec_dir: spec/javascripts
38
+ ```
39
+ $ rails generate jasmine_rails:install
40
+ ```
57
41
 
58
- # list of file expressions to include as helpers into spec runner
59
- # relative path from spec_dir
60
- helpers:
61
- - "helpers/**/*.{js,coffee}"
42
+ The generator will create the necessary configuration files and mount a test
43
+ runner to [/specs](http://localhost:3000/specs) so that you can get started
44
+ writing specs!
62
45
 
63
- # list of file expressions to include as specs into spec runner
64
- # relative path from spec_dir
65
- spec_files:
66
- - "**/*[Ss]pec.{js,coffee}"
46
+ ## Configuration
67
47
 
68
- # path to directory of temporary files
69
- # (spec runner and asset cache)
70
- # defaults to spec/tmp
71
- tmp_dir: "spec/tmp"
72
- ```
48
+ Configuring the Jasmine test runner is done in `spec/javascripts/support/jasmine.yml`. [Here's an example](https://github.com/searls/jasmine-rails/tree/master/spec/javascripts/support) from this repo's [dummy project](https://github.com/searls/jasmine-rails/tree/master/spec/dummy).
73
49
 
74
50
  ## Asset Pipeline Support
75
51
 
76
- The jasmine-rails gem *fully* supports the Rails asset pipeline which means you can:
52
+ The jasmine-rails gem fully supports the Rails asset pipeline which means you can:
53
+
77
54
  * use `coffee_script` or other Javascript precompilers for source or
78
55
  test files
79
56
  * use sprockets directives to control inclusion/exclusion of dependent
@@ -0,0 +1,19 @@
1
+ require 'rails/generators/base'
2
+
3
+ module JasmineRails
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path("../templates", __FILE__)
7
+
8
+ desc "This generator configures a Rails application for running the Jasmine::Rails testsuite"
9
+
10
+ def create_jasmine_config
11
+ template "jasmine.yml", "spec/javascripts/support/jasmine.yml"
12
+ end
13
+
14
+ def add_routes
15
+ route "mount JasmineRails::Engine => '/specs' if defined?(JasmineRails)"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,10 @@
1
+ require 'rails/generators/named_base'
2
+
3
+ module JasmineRails
4
+ module Generators
5
+ class JasmineRailsGenerator < Rails::Generators::NamedBase
6
+ namespace "jasmine_rails"
7
+ source_root File.expand_path("../templates", __FILE__)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,29 @@
1
+ # path to parent directory of src_files
2
+ # relative path from Rails.root
3
+ # defaults to app/assets/javascripts
4
+ src_dir: "app/assets/javascripts"
5
+
6
+ # list of file expressions to include as source files
7
+ # relative path from src_dir
8
+ src_files:
9
+ - "application.{js,coffee}"
10
+
11
+ # path to parent directory of spec_files
12
+ # relative path from Rails.root
13
+ # defaults to spec/javascripts
14
+ spec_dir: spec/javascripts
15
+
16
+ # list of file expressions to include as helpers into spec runner
17
+ # relative path from spec_dir
18
+ helpers:
19
+ - "helpers/**/*.{js,coffee}"
20
+
21
+ # list of file expressions to include as specs into spec runner
22
+ # relative path from spec_dir
23
+ spec_files:
24
+ - "**/*[Ss]pec.{js,coffee}"
25
+
26
+ # path to directory of temporary files
27
+ # (spec runner and asset cache)
28
+ # defaults to spec/tmp
29
+ tmp_dir: "spec/tmp"
data/lib/jasmine-rails.rb CHANGED
@@ -63,7 +63,7 @@ module JasmineRails
63
63
 
64
64
  def jasmine_config
65
65
  @config ||= begin
66
- path = Rails.root.join('config', 'jasmine.yml')
66
+ path = Rails.root.join('config', 'jasmine.yml')
67
67
  path = Rails.root.join('spec', 'javascripts', 'support', 'jasmine.yml') unless File.exists?(path)
68
68
  initialize_jasmine_config_if_absent(path)
69
69
  YAML.load_file(path)
@@ -94,40 +94,7 @@ module JasmineRails
94
94
  return if File.exist?(path)
95
95
  Rails.logger.warn("Initializing jasmine.yml configuration")
96
96
  FileUtils.mkdir_p(File.dirname(path))
97
- File.open(path, 'w') do |f|
98
- f.write <<-YAML.gsub(/^\s{10}/,'')
99
- # path to parent directory of src_files
100
- # relative path from Rails.root
101
- # defaults to app/assets/javascripts
102
- src_dir: "app/assets/javascripts"
103
-
104
- # list of file expressions to include as source files
105
- # relative path from scr_dir
106
- src_files:
107
- - "application.{js,coffee}"
108
-
109
- # path to parent directory of spec_files
110
- # relative path from Rails.root
111
- # defaults to spec/javascripts
112
- spec_dir: spec/javascripts
113
-
114
- # list of file expressions to include as helpers into spec runner
115
- # relative path from spec_dir
116
- helpers:
117
- - "helpers/**/*.{js,coffee}"
118
-
119
- # list of file expressions to include as specs into spec runner
120
- # relative path from spec_dir
121
- spec_files:
122
- - "**/*[Ss]pec.{js,coffee}"
123
-
124
- # path to directory of temporary files
125
- # (spec runner and asset cache)
126
- # defaults to spec/tmp
127
- tmp_dir: "spec/tmp"
128
- YAML
129
- end
130
-
97
+ FileUtils.cp(File.join(File.dirname(__FILE__), 'generators', 'jasmine_rails', 'templates', 'jasmine.yml'), path)
131
98
  end
132
99
  end
133
100
  end
@@ -1,3 +1,3 @@
1
1
  module JasmineRails
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Justin Searls
@@ -10,39 +11,44 @@ authors:
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2013-12-06 00:00:00.000000000 Z
14
+ date: 2014-01-06 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rails
17
18
  requirement: !ruby/object:Gem::Requirement
19
+ none: false
18
20
  requirements:
19
- - - '>='
21
+ - - ! '>='
20
22
  - !ruby/object:Gem::Version
21
23
  version: 3.1.0
22
24
  type: :runtime
23
25
  prerelease: false
24
26
  version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
25
28
  requirements:
26
- - - '>='
29
+ - - ! '>='
27
30
  - !ruby/object:Gem::Version
28
31
  version: 3.1.0
29
32
  - !ruby/object:Gem::Dependency
30
33
  name: sprockets-rails
31
34
  requirement: !ruby/object:Gem::Requirement
35
+ none: false
32
36
  requirements:
33
- - - '>='
37
+ - - ! '>='
34
38
  - !ruby/object:Gem::Version
35
39
  version: '0'
36
40
  type: :runtime
37
41
  prerelease: false
38
42
  version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
39
44
  requirements:
40
- - - '>='
45
+ - - ! '>='
41
46
  - !ruby/object:Gem::Version
42
47
  version: '0'
43
48
  - !ruby/object:Gem::Dependency
44
49
  name: jasmine-core
45
50
  requirement: !ruby/object:Gem::Requirement
51
+ none: false
46
52
  requirements:
47
53
  - - ~>
48
54
  - !ruby/object:Gem::Version
@@ -50,6 +56,7 @@ dependencies:
50
56
  type: :runtime
51
57
  prerelease: false
52
58
  version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
53
60
  requirements:
54
61
  - - ~>
55
62
  - !ruby/object:Gem::Version
@@ -57,15 +64,17 @@ dependencies:
57
64
  - !ruby/object:Gem::Dependency
58
65
  name: testbeds
59
66
  requirement: !ruby/object:Gem::Requirement
67
+ none: false
60
68
  requirements:
61
- - - '>='
69
+ - - ! '>='
62
70
  - !ruby/object:Gem::Version
63
71
  version: '0'
64
72
  type: :development
65
73
  prerelease: false
66
74
  version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
67
76
  requirements:
68
- - - '>='
77
+ - - ! '>='
69
78
  - !ruby/object:Gem::Version
70
79
  version: '0'
71
80
  description: Provides a Jasmine Spec Runner that plays nicely with Rails 3.1 assets
@@ -89,6 +98,9 @@ files:
89
98
  - lib/assets/javascripts/jasmine-console-shims.js
90
99
  - lib/assets/javascripts/jasmine-runner.js
91
100
  - lib/assets/javascripts/jasmine-specs.js.erb
101
+ - lib/generators/jasmine_rails/install_generator.rb
102
+ - lib/generators/jasmine_rails/jasmine_rails_generator.rb
103
+ - lib/generators/jasmine_rails/templates/jasmine.yml
92
104
  - lib/jasmine-rails.rb
93
105
  - lib/jasmine_rails/engine.rb
94
106
  - lib/jasmine_rails/offline_asset_paths.rb
@@ -102,25 +114,32 @@ files:
102
114
  - README.md
103
115
  homepage: http://github.com/searls/jasmine-rails
104
116
  licenses: []
105
- metadata: {}
106
117
  post_install_message:
107
118
  rdoc_options: []
108
119
  require_paths:
109
120
  - lib
110
121
  required_ruby_version: !ruby/object:Gem::Requirement
122
+ none: false
111
123
  requirements:
112
- - - '>='
124
+ - - ! '>='
113
125
  - !ruby/object:Gem::Version
114
126
  version: '0'
127
+ segments:
128
+ - 0
129
+ hash: 4536583753513077706
115
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
+ none: false
116
132
  requirements:
117
- - - '>='
133
+ - - ! '>='
118
134
  - !ruby/object:Gem::Version
119
135
  version: '0'
136
+ segments:
137
+ - 0
138
+ hash: 4536583753513077706
120
139
  requirements: []
121
140
  rubyforge_project:
122
- rubygems_version: 2.0.3
141
+ rubygems_version: 1.8.23
123
142
  signing_key:
124
- specification_version: 4
143
+ specification_version: 3
125
144
  summary: Makes Jasmine easier on Rails 3.1
126
145
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 3f6b63ced5a6870dffb4f378a4220a816180e18b
4
- data.tar.gz: 59ae4feb8178a6bc3b4a224ecfaaf47cab6802a6
5
- SHA512:
6
- metadata.gz: d665f29c9d7009f328fb928efc925bf3106f59eb5be64761223efb987d3812d0dd3d2d60be83a0a1e071711ca5646f1a35373df10679fd2ade6da6a33292dced
7
- data.tar.gz: 4127e9dddfe68d1eb6deb8ba2d11885c24a1b4e072df144afb52130b5e0d7c358f898dfe75e1b0aa2ff1f7819f1e2f126a075497d30e4ea40b54ea4a7fd9a5f7