flatrack 1.1.0 → 1.1.1

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: c19e4a9f13cab919d16beac789e1030adc8484ef
4
- data.tar.gz: e28d6c79ef1c3fde4e1a117c160d0c339b4b9f52
3
+ metadata.gz: 18f2a64112e63e97157245c00c1ea592bf0afbdb
4
+ data.tar.gz: eca104199ffa912f5b4dbc87f8423027c0512a8b
5
5
  SHA512:
6
- metadata.gz: ccafe9a3cfc1b91d6cbce338062f6d71767e8840cbcc81a0fb5aa15b0aec8a114b27f1a7a10a26aa2e5604de61976f91b8af32b1d6ca370c6e11c0a586484fa0
7
- data.tar.gz: 5de8c2db8beea1d99f89db153f38b0c4ebe4ea573da2a879bbb2a082a32cb3fed458265f2a9d7ff1f293679c5481b2f5c53b8aff3bdfc10425d3041841eec29f
6
+ metadata.gz: c0d551d21329e7c2a1848e02c538a606dc558d32a0fcafbe40282c00a5ff26bab931cd44ba922220b07a8f634df322a0d21b951936e41d1ec24300616426f6e8
7
+ data.tar.gz: ead79f7435dd9b79962112da8d38866d13505163ea109b3bd37d012d3b80b9705ecc8e2c544aaa75481f8a9201e023f1dc0d7a6119e7b5eaa6e7db5aa1af788c
data/.gitignore CHANGED
@@ -2,4 +2,5 @@ Gemfile.lock
2
2
  pkg/*
3
3
  *.gem
4
4
  tmp
5
- coverage
5
+ coverage
6
+ /.sass-cache/
@@ -1,3 +1,9 @@
1
+ # Flatrack 1.1.1 (March 05, 2014)
2
+
3
+ * Fix gem build errors, and update dependencies.
4
+
5
+ *Jason Waldrip*
6
+
1
7
  # Flatrack 1.1.0 (March 05, 2014)
2
8
 
3
9
  * Added support for rendering partials in views
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
1
  source 'https://rubygems.org'
2
- gemspec unless ENV['RM_INFO']
2
+ gemspec
data/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
 
4
4
  [![Version](http://allthebadges.io/jwaldrip/flatrack/badge_fury.png)](http://allthebadges.io/jwaldrip/flatrack/badge_fury)
5
5
  [![Dependencies](http://allthebadges.io/jwaldrip/flatrack/gemnasium.png)](http://allthebadges.io/jwaldrip/flatrack/gemnasium)
6
- [![Build Status](http://allthebadges.io/jwaldrip/flatrack/travis.png?1)](http://allthebadges.io/jwaldrip/flatrack/travis)
7
- [![Coverage](http://allthebadges.io/jwaldrip/flatrack/coveralls.png)](http://allthebadges.io/jwaldrip/flatrack/coveralls)
6
+ [![Build Status](http://allthebadges.io/jwaldrip/flatrack/travis.png)](http://allthebadges.io/jwaldrip/flatrack/travis)
7
+ [![Coverage](http://allthebadges.io/jwaldrip/flatrack/coveralls.png?1)](http://allthebadges.io/jwaldrip/flatrack/coveralls)
8
8
  [![Code Climate](http://allthebadges.io/jwaldrip/flatrack/code_climate.png)](http://allthebadges.io/jwaldrip/flatrack/code_climate)
9
9
 
10
10
  ## About
@@ -30,20 +30,20 @@ based routing.
30
30
 
31
31
  # Dependencies
32
32
  spec.add_runtime_dependency 'rack', '~> 1.4'
33
- spec.add_runtime_dependency 'activesupport', '~> 3.2'
33
+ spec.add_runtime_dependency 'activesupport', ['> 3.2', '< 4.2']
34
34
  spec.add_runtime_dependency 'sass', '~> 3.2'
35
35
  spec.add_runtime_dependency 'sprockets-sass', '~> 1.0'
36
36
  spec.add_runtime_dependency 'thor', '~> 0.18'
37
37
  spec.add_runtime_dependency 'coffee-script', '~> 2.2'
38
- spec.add_runtime_dependency 'rake', '~> 0.8'
38
+ spec.add_runtime_dependency 'rake', ['> 0.8.7', '< 10.2']
39
39
 
40
40
  # Dev Dependencies
41
41
  spec.add_development_dependency 'bundler', '~> 1.5'
42
- spec.add_development_dependency 'rspec', '~> 3.0.0.beta'
42
+ spec.add_development_dependency 'rspec', '~> 2.14'
43
43
  spec.add_development_dependency 'guard', '~> 2.5'
44
44
  spec.add_development_dependency 'guard-rspec', '~> 4.2'
45
45
  spec.add_development_dependency 'guard-bundler', '~> 2.0'
46
- spec.add_development_dependency 'pry', '~> 0.9.12.6'
47
- spec.add_development_dependency 'coveralls', '~> 0.7.0'
48
- spec.add_development_dependency 'simplecov', '~> 0.8.2'
46
+ spec.add_development_dependency 'pry', '~> 0.9'
47
+ spec.add_development_dependency 'coveralls', '~> 0.7'
48
+ spec.add_development_dependency 'simplecov', '~> 0.8'
49
49
  end
@@ -2,6 +2,7 @@ require 'flatrack/version'
2
2
  require 'active_support/all'
3
3
  require 'sprockets'
4
4
  require 'sprockets-sass'
5
+ require 'coffee-script'
5
6
  require 'sass'
6
7
  require 'rack'
7
8
 
@@ -1,3 +1,3 @@
1
1
  class Flatrack
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
@@ -10,11 +10,13 @@ module Rake
10
10
  #
11
11
  class AssetTasks < Rake::TaskLib
12
12
  attr_accessor :output
13
- attr_accessor :environment
13
+ attr_reader :environment
14
14
  attr_reader :index
15
15
  attr_reader :manifest
16
16
  attr_reader :keep
17
17
 
18
+ delegate :paths, to: :environment
19
+
18
20
  # Number of old assets to keep.
19
21
 
20
22
  # Logger to use during rake tasks. Defaults to using stderr.
@@ -46,15 +48,16 @@ module Rake
46
48
  @logger = Logger.new($stderr)
47
49
  @logger.level = Logger::INFO
48
50
  @output = './public/assets'
49
- yield self
50
- @index = environment.index
51
- @manifest = Sprockets::Manifest.new(index, output)
52
- @keep = 2
51
+ yield self if block_given?
52
+ @index = environment.index
53
+ @manifest = Sprockets::Manifest.new(index, output)
54
+ @keep = 2
53
55
  define
54
56
  end
55
57
 
56
58
  def assets
57
- Dir['assets/**/*.*'].map do |file|
59
+ files = paths.reduce([]) { |a, p| a + Dir[File.join p, '**', '*'] }
60
+ files.map do |file|
58
61
  file_basename = File.basename file
59
62
  parts = file_basename.split('.').size
60
63
  file = file.split('.').tap(&:pop).join('.') if parts > 2
@@ -1,55 +1,73 @@
1
1
  require 'spec_helper'
2
+ require 'flatrack'
2
3
  require 'rake/asset_tasks'
3
- require 'coffee-script'
4
4
 
5
5
  describe Rake::AssetTasks do
6
6
  include FileUtils
7
+ include SiteHelper
7
8
 
8
9
  before(:all) do
9
- @rake = Rake::Application.new
10
- Rake.application = @rake
10
+ @sha = site(clean: false) do
11
+ @rake = Rake::Application.new
12
+ Rake.application = @rake
11
13
 
12
- @env = Sprockets::Environment.new(".") do |env|
13
- env.append_path File.join Flatrack.gem_root, '../spec/fixtures/assets'
14
- end
15
-
16
- @dir = File.join(Dir::tmpdir, 'sprockets/manifest')
14
+ @env = Flatrack.assets
15
+ @dir = File.join(Dir::tmpdir, 'sprockets/manifest')
17
16
 
18
- @manifest = Sprockets::Manifest.new(@env, @dir)
19
-
20
- Rake::AssetTasks.new do |t|
21
- t.environment = @env
22
- t.output = @dir
23
- t.log_level = :fatal
17
+ Rake::AssetTasks.new do |t|
18
+ t.output = @dir
19
+ t.log_level = :fatal
20
+ end
24
21
  end
25
22
  end
26
23
 
27
24
  after(:all) do
28
25
  Rake.application = nil
26
+ cleanup(@sha)
29
27
  rm_rf(@dir)
30
28
  expect(Dir["#{@dir}/*"]).to be_empty
31
29
  end
32
30
 
33
- it "should precompile" do
34
- digest_path = @env['application.js'].digest_path
35
- expect(File.exist? "#{@dir}/#{digest_path}").to be false
31
+ describe '#log_level=' do
32
+ it 'should set the proper log level' do
33
+ @sha = site(clean: false) do
34
+ allow_any_instance_of(Rake::AssetTasks).to receive(:define)
35
+ tasks = Rake::AssetTasks.new do |t|
36
+ t.output = @dir
37
+ t.log_level = 1
38
+ end
39
+ expect(tasks.log_level).to eq 1
40
+ end
41
+ end
42
+ end
36
43
 
37
- @rake['assets:precompile'].invoke
44
+ describe 'tasks' do
38
45
 
39
- expect(Dir["#{@dir}/manifest-*.json"]).to be_present
40
- expect(File.exist? "#{@dir}/#{digest_path}").to be true
41
- end
46
+ it "should precompile" do
47
+ digest_path = @env['main.js'].digest_path
48
+ expect(File.exist? "#{@dir}/#{digest_path}").to be false
42
49
 
43
- it "should clobber" do
44
- digest_path = @env['application.js'].digest_path
50
+ @rake['assets:precompile'].invoke
45
51
 
46
- @rake['assets:precompile'].invoke
47
- expect(File.exist? "#{@dir}/#{digest_path}").to be true
52
+ expect(Dir["#{@dir}/manifest-*.json"]).to be_present
53
+ expect(File.exist? "#{@dir}/#{digest_path}").to be true
54
+ end
48
55
 
49
- @rake['assets:clobber'].invoke
50
- expect(File.exist? "#{@dir}/#{digest_path}").to be false
51
- end
56
+ it "should clobber" do
57
+ digest_path = @env['main.js'].digest_path
58
+
59
+ @rake['assets:precompile'].invoke
60
+ expect(File.exist? "#{@dir}/#{digest_path}").to be true
61
+
62
+ @rake['assets:clobber'].invoke
63
+ expect(File.exist? "#{@dir}/#{digest_path}").to be false
64
+ end
65
+
66
+ it "should clean" do
67
+ expect {
68
+ @rake['assets:clean'].invoke
69
+ }.to_not raise_error
70
+ end
52
71
 
53
- xit "should clean" do
54
72
  end
55
73
  end
@@ -16,6 +16,6 @@ Dir["./spec/support/**/*.rb"].sort.each {|f| require f}
16
16
 
17
17
  RSpec.configure do |config|
18
18
  config.run_all_when_everything_filtered = true
19
- config.filter_run :focus
19
+ config.filter_run focus: true
20
20
  config.before(:each){ Flatrack.reset! }
21
21
  end
@@ -5,7 +5,7 @@ module SiteHelper
5
5
  DIR = File.join Flatrack.gem_root, '../tmp/flatrack-sites'
6
6
  mkdir_p DIR
7
7
 
8
- def site
8
+ def site(clean: true)
9
9
  sha = SecureRandom.hex
10
10
  in_temp_sites do
11
11
  Flatrack::CLI.start(
@@ -15,7 +15,7 @@ module SiteHelper
15
15
  yield
16
16
  end
17
17
  end
18
- cleanup sha
18
+ clean ? cleanup(sha) : sha
19
19
  rescue => error
20
20
  cleanup sha
21
21
  raise error
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flatrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Waldrip
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.2'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '4.2'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '3.2'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '4.2'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: sass
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -98,16 +104,22 @@ dependencies:
98
104
  name: rake
99
105
  requirement: !ruby/object:Gem::Requirement
100
106
  requirements:
101
- - - "~>"
107
+ - - ">"
102
108
  - !ruby/object:Gem::Version
103
- version: '0.8'
109
+ version: 0.8.7
110
+ - - "<"
111
+ - !ruby/object:Gem::Version
112
+ version: '10.2'
104
113
  type: :runtime
105
114
  prerelease: false
106
115
  version_requirements: !ruby/object:Gem::Requirement
107
116
  requirements:
108
- - - "~>"
117
+ - - ">"
109
118
  - !ruby/object:Gem::Version
110
- version: '0.8'
119
+ version: 0.8.7
120
+ - - "<"
121
+ - !ruby/object:Gem::Version
122
+ version: '10.2'
111
123
  - !ruby/object:Gem::Dependency
112
124
  name: bundler
113
125
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +140,14 @@ dependencies:
128
140
  requirements:
129
141
  - - "~>"
130
142
  - !ruby/object:Gem::Version
131
- version: 3.0.0.beta
143
+ version: '2.14'
132
144
  type: :development
133
145
  prerelease: false
134
146
  version_requirements: !ruby/object:Gem::Requirement
135
147
  requirements:
136
148
  - - "~>"
137
149
  - !ruby/object:Gem::Version
138
- version: 3.0.0.beta
150
+ version: '2.14'
139
151
  - !ruby/object:Gem::Dependency
140
152
  name: guard
141
153
  requirement: !ruby/object:Gem::Requirement
@@ -184,42 +196,42 @@ dependencies:
184
196
  requirements:
185
197
  - - "~>"
186
198
  - !ruby/object:Gem::Version
187
- version: 0.9.12.6
199
+ version: '0.9'
188
200
  type: :development
189
201
  prerelease: false
190
202
  version_requirements: !ruby/object:Gem::Requirement
191
203
  requirements:
192
204
  - - "~>"
193
205
  - !ruby/object:Gem::Version
194
- version: 0.9.12.6
206
+ version: '0.9'
195
207
  - !ruby/object:Gem::Dependency
196
208
  name: coveralls
197
209
  requirement: !ruby/object:Gem::Requirement
198
210
  requirements:
199
211
  - - "~>"
200
212
  - !ruby/object:Gem::Version
201
- version: 0.7.0
213
+ version: '0.7'
202
214
  type: :development
203
215
  prerelease: false
204
216
  version_requirements: !ruby/object:Gem::Requirement
205
217
  requirements:
206
218
  - - "~>"
207
219
  - !ruby/object:Gem::Version
208
- version: 0.7.0
220
+ version: '0.7'
209
221
  - !ruby/object:Gem::Dependency
210
222
  name: simplecov
211
223
  requirement: !ruby/object:Gem::Requirement
212
224
  requirements:
213
225
  - - "~>"
214
226
  - !ruby/object:Gem::Version
215
- version: 0.8.2
227
+ version: '0.8'
216
228
  type: :development
217
229
  prerelease: false
218
230
  version_requirements: !ruby/object:Gem::Requirement
219
231
  requirements:
220
232
  - - "~>"
221
233
  - !ruby/object:Gem::Version
222
- version: 0.8.2
234
+ version: '0.8'
223
235
  description: |+
224
236
  A rack based static site builder with templates, layouts and project structure
225
237
  based routing.