cyborg 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/lib/cyborg.rb +4 -2
- data/lib/cyborg/command.rb +2 -16
- data/lib/cyborg/plugin/assets/svgs.rb +1 -1
- data/lib/cyborg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abc605cb6e19c51aea7d3e178642922bc86f1e33
|
4
|
+
data.tar.gz: cca559ee3a6a8543680b42405e7b89cb53a6aa60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f501299e3f681bbb1e0c919e5255faaf46906cefaee7f5469bf84ae867c756d0247cacd2812dde5e3f9b00f7bcd3cabc853e44fa6724f6e77e43dd85475210b
|
7
|
+
data.tar.gz: 03e1229e046af7a466d066236a6ead0a8efa264b39248c750133f01b6337fedfffa7d0a7e64f181fe2b8e1ca9dc10174c58454fef5db72a2e9463968652edf4e
|
data/lib/cyborg.rb
CHANGED
@@ -55,8 +55,8 @@ module Cyborg
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def rails_path
|
59
|
-
if at_rails_root
|
58
|
+
def rails_path(sub=nil)
|
59
|
+
path = if at_rails_root
|
60
60
|
Dir.pwd
|
61
61
|
else
|
62
62
|
dir = Dir["**/bin/rails"]
|
@@ -64,5 +64,7 @@ module Cyborg
|
|
64
64
|
dir.first.split('/').first
|
65
65
|
end
|
66
66
|
end
|
67
|
+
path = File.join(path, sub) if sub
|
68
|
+
path
|
67
69
|
end
|
68
70
|
end
|
data/lib/cyborg/command.rb
CHANGED
@@ -33,7 +33,7 @@ module Cyborg
|
|
33
33
|
# Build assets
|
34
34
|
def build(options={})
|
35
35
|
puts 'Building…'
|
36
|
-
require File.join(Dir.pwd, Cyborg.rails_path
|
36
|
+
require File.join(Dir.pwd, Cyborg.rails_path('config/application'))
|
37
37
|
@threads.concat Cyborg.plugin.build(options)
|
38
38
|
end
|
39
39
|
|
@@ -52,24 +52,10 @@ module Cyborg
|
|
52
52
|
|
53
53
|
# Run rails server and watch assets
|
54
54
|
def server(options={})
|
55
|
-
@threads << Thread.new {
|
55
|
+
@threads << Thread.new { system "#{Cyborg.rails_path('bin/rails')} server" }
|
56
56
|
watch(options) if options[:watch]
|
57
57
|
end
|
58
58
|
|
59
|
-
def from_rails(command=nil, &blk)
|
60
|
-
unless dir = Cyborg.rails_path
|
61
|
-
abort "Command must be run from the root of a Cyborg Plugin project, or in its Rails 'site' directory."
|
62
|
-
end
|
63
|
-
|
64
|
-
Dir.chdir(dir) do
|
65
|
-
if command
|
66
|
-
system command
|
67
|
-
else
|
68
|
-
blk.call
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
59
|
def from_root(command=nil, &blk)
|
74
60
|
unless dir = Cyborg.gem_path
|
75
61
|
abort "Command must be run from the root of a Cyborg Plugin (adjacent to the gemspec)."
|
@@ -12,7 +12,7 @@ module Cyborg
|
|
12
12
|
@svg = Esvg.new({
|
13
13
|
config_file: File.join(plugin.root, 'esvg.yml'),
|
14
14
|
path: path,
|
15
|
-
tmp_path:
|
15
|
+
tmp_path: Cyborg.rails_path('tmp/cache/assets'),
|
16
16
|
js_path: File.join(plugin.paths[:javascripts], '_svg.js'),
|
17
17
|
optimize: true
|
18
18
|
})
|
data/lib/cyborg/version.rb
CHANGED