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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07256e2ad9fe07490476d23e2c00d348d78a8f7e
4
- data.tar.gz: e46a29def80e707128522a6190d069c6704ba78b
3
+ metadata.gz: abc605cb6e19c51aea7d3e178642922bc86f1e33
4
+ data.tar.gz: cca559ee3a6a8543680b42405e7b89cb53a6aa60
5
5
  SHA512:
6
- metadata.gz: 2f0d968eae626ade7d658a0d72b31cce7d563362548f433c1474244b7ebf265b5d583f3ae2fea887a2c103e8757568bf73afdaea26738a2615a24df7f210ce4f
7
- data.tar.gz: 77706d396805e4dada36d0cc3283ddaf9fd7f0224f565a3750bf4fc6a341704eb4bd1e58c3a13ccbad4b0cf12111e90cd86e39cbefe0b9c145e07459eb8d3729
6
+ metadata.gz: 9f501299e3f681bbb1e0c919e5255faaf46906cefaee7f5469bf84ae867c756d0247cacd2812dde5e3f9b00f7bcd3cabc853e44fa6724f6e77e43dd85475210b
7
+ data.tar.gz: 03e1229e046af7a466d066236a6ead0a8efa264b39248c750133f01b6337fedfffa7d0a7e64f181fe2b8e1ca9dc10174c58454fef5db72a2e9463968652edf4e
@@ -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
@@ -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, 'config/application')
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 { from_rails 'rails server' }
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: File.join(Cyborg.rails_path, 'tmp/cache/assets'),
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
  })
@@ -1,3 +1,3 @@
1
1
  module Cyborg
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyborg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis