angularjs-rails-cdn 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 934ac1bb514fa5ddb567fab09e1f9f053d0f6268
4
- data.tar.gz: 2cbb0a6a8f4fbfafe927f6b01930cebfdc4158db
3
+ metadata.gz: 3684cfa5686acc3cfd3da989ce8d88bd5068cc71
4
+ data.tar.gz: c896ca34d847adadbb764450371e18984881e568
5
5
  SHA512:
6
- metadata.gz: 08057ebe07825e71a7a7d28fae9807425bf609a0d96149362f4f0e4d1cb6117b4113a706503cb84858b3c06ae29908049057592fde9ebde268177f3227a616f0
7
- data.tar.gz: b448f9bbca43ac64ff146b08bd7cc3f739df11537d37da328ec0083745a8e37decb89d363588d7f0c5d09355c88013e7bcb39cddc74f8f8234ac5e3c135c621e
6
+ metadata.gz: 1a66444cfda304304f446edb7c57f4e43e590afa70b9b7f2f0b29e60e1a8fdaa956ab56f8461311e83c6d9bca88932b3ab2dec82e591546f116940ae569dae89
7
+ data.tar.gz: 0bee5fbe310cef8e64c58ee2f3419abde0a2dea7c5ddd08d7a9f95594b2af26c975180325878e402b243fb0d700829d64f82797f5ddd222f74421750425b58a3
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -38,6 +38,7 @@ Implications of externalizing AngularJS from `application.js` are:
38
38
 
39
39
  Changelog:
40
40
 
41
+ * v0.1.3: Be a bit more html_safe
41
42
  * v0.1.2: Specified license in spec file
42
43
  * v0.1.1: Pass options to javascript_include_tag
43
44
  * v0.1.0: Initial release
data/Rakefile CHANGED
@@ -1 +1,7 @@
1
1
  require 'bundler/gem_tasks'
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new
5
+
6
+ task default: :spec
7
+ task test: :spec
@@ -1,3 +1,4 @@
1
+ require 'active_support/core_ext/string/output_safety'
1
2
  require 'angularjs-rails'
2
3
  require 'angularjs-rails-cdn/version'
3
4
 
@@ -17,7 +18,7 @@ module AngularJS::Rails::Cdn
17
18
  def angularjs_include_tag(name, options = {})
18
19
  version = options[:version] || ANGULARJS_VERSION
19
20
 
20
- local_includes = modules(options[:modules]).map { |m| javascript_include_tag(m) }.join
21
+ local_includes = modules(options[:modules]).map { |m| javascript_include_tag(m) }.join.html_safe
21
22
 
22
23
  return local_includes if OFFLINE and !options[:force]
23
24
 
@@ -1,7 +1,7 @@
1
1
  module AngularJS
2
2
  module Rails
3
3
  module Cdn
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
6
6
  end
7
7
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative 'spec_helper'
4
4
 
5
- def javascript_tag(str)
5
+ def javascript_tag(str, *args)
6
6
  "<s>#{str}</s>".tap do |s|
7
7
  s.class.send(:define_method, :html_safe, ->{ self })
8
8
  end
@@ -49,18 +49,19 @@ describe 'AngularJS::Rails::Cdn::ActionViewExtensions' do
49
49
  end
50
50
 
51
51
  context 'CDN is enforced' do
52
- before do
53
- subject.should_receive(:javascript_include_tag).with('//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js').and_return('<s>//angular.min.js</s>')
54
- end
55
-
56
52
  context 'no additional modules' do
53
+ before do
54
+ subject.should_receive(:javascript_include_tag).with('//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js', force: true, version: '1.1.5').and_return('<s>//angular.min.js</s>')
55
+ end
56
+
57
57
  it { subject.angularjs_include_tag(:google, force: true, version: '1.1.5').should == "<s>//angular.min.js</s><s>window.angular || document.write(unescape('%3Cs>angular.js%3C/s>'))</s>" }
58
58
  end
59
59
 
60
- context 'with submodule' do
60
+ context 'with additional module' do
61
61
  before do
62
+ subject.should_receive(:javascript_include_tag).with('//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js', force: true, version: '1.1.5', modules: [:cookies]).and_return('<s>//angular.min.js</s>')
62
63
  subject.should_receive(:javascript_include_tag).with(:'angular-cookies').and_return('<s>angular-cookies.js</s>')
63
- subject.should_receive(:javascript_include_tag).with('//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular-cookies.min.js').and_return('<s>//angular-cookies.min.js</s>')
64
+ subject.should_receive(:javascript_include_tag).with('//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular-cookies.min.js', force: true, version: '1.1.5', modules: [:cookies]).and_return('<s>//angular-cookies.min.js</s>')
64
65
  end
65
66
 
66
67
  it { subject.angularjs_include_tag(:google, force: true, version: '1.1.5', modules: [:cookies]).should == "<s>//angular.min.js</s><s>//angular-cookies.min.js</s><s>window.angular || document.write(unescape('%3Cs>angular.js%3C/s>%3Cs>angular-cookies.js%3C/s>'))</s>" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angularjs-rails-cdn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikhail Pobolovets
@@ -30,118 +30,118 @@ cert_chain:
30
30
  Z2S2HQ6LJ1YyB0Sjwx2KZ4Sofni5coZE6d4ayx6nFEKQGlSKVIXtc0W3HD3+Q1Ww
31
31
  RYreADroU/Sf7E9uVmOmkQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2013-07-18 00:00:00.000000000 Z
33
+ date: 2013-10-26 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: angularjs-rails
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: railties
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '3.0'
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '3.0'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: bundler
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ~>
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '1.3'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ~>
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
76
  version: '1.3'
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: rake
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - '>='
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: coveralls
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - '>='
109
+ - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  type: :development
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - '>='
116
+ - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: fuubar
121
121
  requirement: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - '>='
123
+ - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  type: :development
127
127
  prerelease: false
128
128
  version_requirements: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - '>='
130
+ - - ">="
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: pry
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - '>='
137
+ - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  type: :development
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - '>='
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  description: Adds CDN support to angularjs-rails
@@ -151,8 +151,8 @@ executables: []
151
151
  extensions: []
152
152
  extra_rdoc_files: []
153
153
  files:
154
- - .gitignore
155
- - .travis.yml
154
+ - ".gitignore"
155
+ - ".travis.yml"
156
156
  - Gemfile
157
157
  - LICENSE
158
158
  - README.md
@@ -174,17 +174,17 @@ require_paths:
174
174
  - lib
175
175
  required_ruby_version: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - '>='
177
+ - - ">="
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  requirements:
182
- - - '>='
182
+ - - ">="
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
185
  requirements: []
186
186
  rubyforge_project:
187
- rubygems_version: 2.0.3
187
+ rubygems_version: 2.1.5
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: Adds CDN support to angularjs-rails
metadata.gz.sig CHANGED
Binary file