evil-front-rails 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/evil-front-rails.gemspec +5 -4
- data/lib/evil-front-rails.rb +9 -0
- data/lib/evil-front/rails/version.rb +1 -1
- data/spec/app/config/application.rb +3 -6
- data/spec/app/config/boot.rb +1 -1
- data/spec/app/config/environment.rb +1 -1
- data/spec/app/config/environments/test.rb +4 -3
- data/spec/app/config/routes.rb +1 -1
- data/spec/app/config/secrets.yml +3 -0
- data/spec/helpers_spec.rb +24 -65
- metadata +20 -6
- data/spec/app/config/initializers/secret_token.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4db3769f488091dc61042f8fda291bd723531aa
|
4
|
+
data.tar.gz: 487f24ea303542f90d8a5cb906969a102462c8f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a009b41d37059fb80efc7de936c047c7ea66377818e5c4ca7120c5e015430d68385039a4166e39946f17e71c64749dd35568483904d37a2e2a03a0d283e42c
|
7
|
+
data.tar.gz: e58243ee4636964eafb288e60c0aa8ee285d399bf2db073b4c98f5e17ae532a42711dd88a8ac2c7795e57f728f53a5e045c1df14a64b3c6a2b09f7b654c501af
|
data/evil-front-rails.gemspec
CHANGED
@@ -20,8 +20,9 @@ Gem::Specification.new do |s|
|
|
20
20
|
min = EvilFront::Rails::VERSION.split('.')[0..1].concat(['0']).join('.')
|
21
21
|
s.add_runtime_dependency 'evil-front-all', "~> #{min}"
|
22
22
|
|
23
|
-
s.add_dependency 'rails',
|
24
|
-
s.add_dependency 'sass-rails',
|
25
|
-
s.add_dependency 'slim-rails',
|
26
|
-
s.add_dependency 'coffee-rails',
|
23
|
+
s.add_dependency 'rails', '>= 3'
|
24
|
+
s.add_dependency 'sass-rails', '>= 3.2.6'
|
25
|
+
s.add_dependency 'slim-rails', '>= 1.1.0'
|
26
|
+
s.add_dependency 'coffee-rails', '>= 3.2.2'
|
27
|
+
s.add_dependency 'ruby-clean-css', '>= 1'
|
27
28
|
end
|
data/lib/evil-front-rails.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
require 'evil-front-all'
|
2
2
|
|
3
|
+
require 'therubyracer'
|
4
|
+
require 'commonjs'
|
5
|
+
require 'ruby-clean-css/version'
|
6
|
+
require 'ruby-clean-css/exports'
|
7
|
+
require 'ruby-clean-css/compressor'
|
8
|
+
|
3
9
|
require 'sass-rails'
|
4
10
|
require 'slim-rails'
|
5
11
|
|
@@ -22,6 +28,9 @@ module EvilFront
|
|
22
28
|
if ::Rails.env.development?
|
23
29
|
app.config.sass.debug_info = true
|
24
30
|
end
|
31
|
+
|
32
|
+
app.config.assets.css_compressor = RubyCleanCSS::Compressor.new(
|
33
|
+
keep_special_comments: :none)
|
25
34
|
end
|
26
35
|
|
27
36
|
initializer 'evil_front.action_view' do
|
@@ -1,14 +1,11 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'action_controller/railtie'
|
4
|
+
require 'sprockets/railtie'
|
5
5
|
|
6
|
-
|
7
|
-
Bundler.require(*Rails.groups(assets: %w(development test)))
|
8
|
-
end
|
6
|
+
Bundler.require(*Rails.groups)
|
9
7
|
|
10
8
|
module App
|
11
9
|
class Application < Rails::Application
|
12
|
-
config.encoding = "utf-8"
|
13
10
|
end
|
14
11
|
end
|
data/spec/app/config/boot.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
2
|
-
require 'bundler/setup'
|
2
|
+
require 'bundler/setup'
|
@@ -1,2 +1,2 @@
|
|
1
1
|
require File.expand_path('../application', __FILE__)
|
2
|
-
|
2
|
+
Rails.application.initialize!
|
@@ -1,11 +1,12 @@
|
|
1
|
-
|
1
|
+
Rails.application.configure do
|
2
2
|
config.cache_classes = true
|
3
|
-
config.serve_static_assets = true
|
4
|
-
config.static_cache_control = "public, max-age=3600"
|
5
3
|
config.eager_load = false
|
4
|
+
config.serve_static_files = true
|
5
|
+
config.static_cache_control = 'public, max-age=3600'
|
6
6
|
config.consider_all_requests_local = true
|
7
7
|
config.action_controller.perform_caching = false
|
8
8
|
config.action_dispatch.show_exceptions = false
|
9
9
|
config.action_controller.allow_forgery_protection = false
|
10
|
+
config.active_support.test_order = :random
|
10
11
|
config.active_support.deprecation = :stderr
|
11
12
|
end
|
data/spec/app/config/routes.rb
CHANGED
data/spec/helpers_spec.rb
CHANGED
@@ -9,9 +9,9 @@ describe HelpersController, type: :controller do
|
|
9
9
|
|
10
10
|
it 'accepts blocks' do
|
11
11
|
get :flying_quotes
|
12
|
-
response.
|
13
|
-
response.body.
|
14
|
-
|
12
|
+
expect(response).to be_success
|
13
|
+
expect(response.body).to eq '<span class="space-before-quote"> </span>' +
|
14
|
+
'<span class="quotes">«<b>text</b>»</span>'
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
@@ -20,8 +20,8 @@ describe HelpersController, type: :controller do
|
|
20
20
|
|
21
21
|
it 'accepts blocks' do
|
22
22
|
get :auto_flying_quotes
|
23
|
-
response.
|
24
|
-
response.body.
|
23
|
+
expect(response).to be_success
|
24
|
+
expect(response.body).to eq '<b><span class="quotes">«a»</span></b>'
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
@@ -30,8 +30,8 @@ describe HelpersController, type: :controller do
|
|
30
30
|
|
31
31
|
it 'accepts blocks' do
|
32
32
|
get :russian_typograph
|
33
|
-
response.
|
34
|
-
response.body.
|
33
|
+
expect(response).to be_success
|
34
|
+
expect(response.body).to eq '<b>«<ф>»</b>'
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
@@ -43,15 +43,15 @@ describe HelpersController, type: :controller do
|
|
43
43
|
|
44
44
|
it 'accepts blocks' do
|
45
45
|
get :typograph_by_locale
|
46
|
-
response.
|
47
|
-
response.body.
|
46
|
+
expect(response).to be_success
|
47
|
+
expect(response.body).to eq '“a”'
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'returns origin blocks on unknown locale' do
|
51
51
|
I18n.locale = :fr
|
52
52
|
get :typograph_by_locale
|
53
|
-
response.
|
54
|
-
response.body.
|
53
|
+
expect(response).to be_success
|
54
|
+
expect(response.body).to eq '"a"'
|
55
55
|
end
|
56
56
|
|
57
57
|
end
|
@@ -67,67 +67,26 @@ describe HelpersController, type: :controller do
|
|
67
67
|
|
68
68
|
it 'generates head tag content' do
|
69
69
|
get :head
|
70
|
-
response.
|
71
|
-
response.body.
|
72
|
-
|
70
|
+
expect(response).to be_success
|
71
|
+
expect(response.body).to eq '<head><meta charset="UTF-8" />' +
|
72
|
+
'<title>1</title><style>a {}</style></head>'
|
73
73
|
end
|
74
74
|
|
75
75
|
it 'adds statistics in production' do
|
76
76
|
Rails.env = ActiveSupport::StringInquirer.new('production')
|
77
77
|
get :head
|
78
|
-
response.
|
79
|
-
response.body.
|
80
|
-
|
78
|
+
expect(response).to be_success
|
79
|
+
expect(response.body).to eq '<head><meta charset="UTF-8" />' +
|
80
|
+
'<title>1</title>' +
|
81
|
+
"<style>a {}</style>stat\n</head>"
|
81
82
|
end
|
82
83
|
|
83
84
|
it 'ignores statistics on demand' do
|
84
85
|
Rails.env = ActiveSupport::StringInquirer.new('production')
|
85
86
|
get :unstat
|
86
|
-
response.
|
87
|
-
response.body.
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
describe 'standard_assets' do
|
94
|
-
|
95
|
-
it 'includes links' do
|
96
|
-
Rails.env = ActiveSupport::StringInquirer.new('development')
|
97
|
-
get :standard_assets
|
98
|
-
response.should be_success
|
99
|
-
response.body.should ==
|
100
|
-
'<link href="/stylesheets/application.css" ' +
|
101
|
-
'media="all" rel="stylesheet" />' +
|
102
|
-
'<script src="/assets/jquery.js"></script>' +
|
103
|
-
'<script src="/javascripts/application.js"></script>'
|
104
|
-
end
|
105
|
-
|
106
|
-
it 'includes CDN jQuery' do
|
107
|
-
Rails.env = ActiveSupport::StringInquirer.new('production')
|
108
|
-
get :standard_assets
|
109
|
-
response.should be_success
|
110
|
-
response.body.should ==
|
111
|
-
'<link href="/stylesheets/application.css" ' +
|
112
|
-
'media="all" rel="stylesheet" />' +
|
113
|
-
'<script src="//ajax.googleapis.com/ajax/libs/jquery/' +
|
114
|
-
"#{ JqueryCdn::VERSION }/jquery.min.js\"></script>" +
|
115
|
-
"<script>window.jQuery || " +
|
116
|
-
"document.write(unescape('%3Cscript " +
|
117
|
-
"src=\"/assets/jquery.js\">%3C/script>'))</script>" +
|
118
|
-
'<script src="/javascripts/application.js"></script>'
|
119
|
-
end
|
120
|
-
|
121
|
-
it 'includes additional libraries' do
|
122
|
-
Rails.env = ActiveSupport::StringInquirer.new('development')
|
123
|
-
get :library
|
124
|
-
response.should be_success
|
125
|
-
response.body.should ==
|
126
|
-
'<link href="/stylesheets/application.css" ' +
|
127
|
-
'media="all" rel="stylesheet" />' +
|
128
|
-
'<script src="/assets/jquery.js"></script>' +
|
129
|
-
'<link src="a" />' +
|
130
|
-
'<script src="/javascripts/application.js"></script>'
|
87
|
+
expect(response).to be_success
|
88
|
+
expect(response.body).to eq '<head><meta charset="UTF-8" />' +
|
89
|
+
'<title>2</title></head>'
|
131
90
|
end
|
132
91
|
|
133
92
|
end
|
@@ -136,9 +95,9 @@ describe HelpersController, type: :controller do
|
|
136
95
|
|
137
96
|
it 'renders telephone link' do
|
138
97
|
get :tel
|
139
|
-
response.
|
140
|
-
response.body.
|
141
|
-
|
98
|
+
expect(response).to be_success
|
99
|
+
expect(response.body).to eq '<a class="tel phone" data-role="call" ' +
|
100
|
+
'href="tel:+555">+5 55</a>'
|
142
101
|
end
|
143
102
|
|
144
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evil-front-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evil-front-all
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 3.2.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: ruby-clean-css
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1'
|
83
97
|
description:
|
84
98
|
email: andrey@sitnik.ru
|
85
99
|
executables: []
|
@@ -114,8 +128,8 @@ files:
|
|
114
128
|
- spec/app/config/environment.rb
|
115
129
|
- spec/app/config/environments/test.rb
|
116
130
|
- spec/app/config/initializers/i18n.rb
|
117
|
-
- spec/app/config/initializers/secret_token.rb
|
118
131
|
- spec/app/config/routes.rb
|
132
|
+
- spec/app/config/secrets.yml
|
119
133
|
- spec/helpers_spec.rb
|
120
134
|
- spec/spec_helper.rb
|
121
135
|
homepage: https://github.com/ai/evil-front
|
@@ -138,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
152
|
version: '0'
|
139
153
|
requirements: []
|
140
154
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.5.1
|
142
156
|
signing_key:
|
143
157
|
specification_version: 4
|
144
158
|
summary: Helpers, Sass mixins, JS shortcuts, workflow and Rails settings from Evil
|
@@ -1 +0,0 @@
|
|
1
|
-
App::Application.config.secret_key_base = 'test'
|