machined 1.0.0 → 1.0.1
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/lib/machined/context.rb +5 -5
- data/lib/machined/environment.rb +65 -63
- data/lib/machined/helpers/asset_tag_helpers.rb +2 -2
- data/lib/machined/helpers/locals_helpers.rb +5 -5
- data/lib/machined/helpers/output_helpers.rb +3 -3
- data/lib/machined/helpers/page_helpers.rb +2 -2
- data/lib/machined/helpers/render_helpers.rb +14 -14
- data/lib/machined/index.rb +3 -3
- data/lib/machined/initializable.rb +7 -7
- data/lib/machined/processors/front_matter_processor.rb +2 -2
- data/lib/machined/processors/layout_processor.rb +11 -11
- data/lib/machined/sprocket.rb +8 -8
- data/lib/machined/static_compiler.rb +9 -9
- data/lib/machined/utils.rb +1 -1
- data/lib/machined/version.rb +1 -1
- data/spec/machined/context_spec.rb +1 -1
- data/spec/machined/environment_spec.rb +67 -52
- data/spec/machined/helpers/asset_tag_helpers_spec.rb +12 -12
- data/spec/machined/helpers/locals_helper_spec.rb +5 -5
- data/spec/machined/helpers/page_helpers_spec.rb +9 -9
- data/spec/machined/helpers/render_helpers_spec.rb +17 -17
- data/spec/machined/initializable_spec.rb +9 -9
- data/spec/machined/processors/front_matter_processor_spec.rb +4 -4
- data/spec/machined/processors/layout_processor_spec.rb +9 -9
- data/spec/machined/sprocket_spec.rb +3 -3
- data/spec/machined/static_compiler_spec.rb +25 -3
- data/spec/machined/utils_spec.rb +3 -3
- data/spec/support/be_fresh_matcher.rb +2 -2
- data/spec/support/helpers.rb +7 -7
- data/spec/support/match_paths_matcher.rb +3 -3
- metadata +3 -3
data/spec/support/helpers.rb
CHANGED
@@ -8,29 +8,29 @@ module Machined
|
|
8
8
|
@machined = nil if config.delete(:reload)
|
9
9
|
@machined ||= Machined::Environment.new(config.reverse_merge(:skip_bundle => true, :skip_autoloading => true))
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
# Convenience method for creating a new Machined sprocket,
|
13
13
|
# with an automatic reference to the current Machined
|
14
14
|
# environment instance.
|
15
15
|
def create_sprocket(config = {})
|
16
16
|
Machined::Sprocket.new machined, config
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
# Returns a fresh context, that can be used to test helpers.
|
20
20
|
def build_context(logical_path = 'application.js', options = {})
|
21
21
|
pathname = options[:pathname] || Pathname.new('assets').join(logical_path).expand_path
|
22
22
|
env = options[:env] || machined.assets
|
23
|
-
|
23
|
+
|
24
24
|
env.context_class.new env, logical_path, pathname
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
# Runs the CLI with the given args.
|
28
28
|
def machined_cli(args, silence = true)
|
29
29
|
capture(:stdout) {
|
30
30
|
Machined::CLI.start args.split(' ')
|
31
31
|
}
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
# Modifies the given file
|
35
35
|
def modify(file, content = nil)
|
36
36
|
Pathname.new(file).tap do |file|
|
@@ -39,7 +39,7 @@ module Machined
|
|
39
39
|
file.utime future, future
|
40
40
|
end
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
# Captures the given stream and returns it:
|
44
44
|
#
|
45
45
|
# stream = capture(:stdout) { puts 'Cool' }
|
@@ -54,7 +54,7 @@ module Machined
|
|
54
54
|
ensure
|
55
55
|
eval "$#{stream} = #{stream.upcase}"
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
result
|
59
59
|
end
|
60
60
|
end
|
@@ -8,13 +8,13 @@ RSpec::Matchers.define :match_paths do |expected|
|
|
8
8
|
expected.map!(&:to_s)
|
9
9
|
actual.map!(&:to_s)
|
10
10
|
expected.map! { |path| File.join(@root, path) } if @root
|
11
|
-
|
11
|
+
|
12
12
|
actual == expected
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
chain :with_root do |root|
|
16
16
|
@root = root.to_s
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
diffable
|
20
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: machined
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -428,7 +428,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
428
428
|
version: '0'
|
429
429
|
segments:
|
430
430
|
- 0
|
431
|
-
hash:
|
431
|
+
hash: 3309700500908118760
|
432
432
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
433
433
|
none: false
|
434
434
|
requirements:
|
@@ -437,7 +437,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
437
437
|
version: '0'
|
438
438
|
segments:
|
439
439
|
- 0
|
440
|
-
hash:
|
440
|
+
hash: 3309700500908118760
|
441
441
|
requirements: []
|
442
442
|
rubyforge_project: machined
|
443
443
|
rubygems_version: 1.8.23
|