bower-rails 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/tasks/bower.rake +14 -4
  2. metadata +8 -6
  3. checksums.yaml +0 -7
data/lib/tasks/bower.rake CHANGED
@@ -37,9 +37,18 @@ namespace :bower do
37
37
  end
38
38
  end
39
39
 
40
+ def get_bower_root_path
41
+ if defined?(Rails)
42
+ return Rails.root
43
+ else
44
+ return Dir.pwd
45
+ end
46
+ end
47
+
40
48
  def dsl_perform_command remove_components = true
41
- BowerRails::Dsl.config = {:root_path => Rails.root}
42
- dsl = BowerRails::Dsl.evalute(Rails.root.join("Jsfile"))
49
+ bower_root = get_bower_root_path
50
+ BowerRails::Dsl.config = {:root_path => bower_root}
51
+ dsl = BowerRails::Dsl.evalute(File.join(bower_root, "Jsfile"))
43
52
 
44
53
  if remove_components
45
54
  dsl.write_bower_json
@@ -55,8 +64,9 @@ end
55
64
 
56
65
  #run the passed bower block in appropriate folders
57
66
  def perform_command remove_components = true
67
+ bower_root = get_bower_root_path
58
68
  #load in bower json file
59
- txt = File.read("#{Rails.root}/bower.json")
69
+ txt = File.read(File.join(bower_root, "bower.json"))
60
70
  json = JSON.parse(txt)
61
71
 
62
72
  ["lib", "vendor"].each do |dir|
@@ -64,7 +74,7 @@ def perform_command remove_components = true
64
74
  data = json[dir]
65
75
 
66
76
  #check folder existence and create?
67
- dir = "#{Rails.root}/#{dir}/assets"
77
+ dir = File.join(bower_root, "dir", "assets")
68
78
  FileUtils.mkdir_p dir unless File.directory? dir
69
79
  #go in to dir to act
70
80
  Dir.chdir(dir) do
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bower-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Ross Harrison
@@ -26,25 +27,26 @@ files:
26
27
  - README.md
27
28
  homepage: https://github.com/rharriso/bower-rails
28
29
  licenses: []
29
- metadata: {}
30
30
  post_install_message:
31
31
  rdoc_options: []
32
32
  require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
+ none: false
35
36
  requirements:
36
- - - '>='
37
+ - - ! '>='
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0'
39
40
  required_rubygems_version: !ruby/object:Gem::Requirement
41
+ none: false
40
42
  requirements:
41
- - - '>='
43
+ - - ! '>='
42
44
  - !ruby/object:Gem::Version
43
45
  version: '0'
44
46
  requirements: []
45
47
  rubyforge_project:
46
- rubygems_version: 2.0.3
48
+ rubygems_version: 1.8.25
47
49
  signing_key:
48
- specification_version: 4
50
+ specification_version: 3
49
51
  summary: Bower for Rails
50
52
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 5cb67f76bfaa66d517071c94179c6939875b5444
4
- data.tar.gz: 58a066463fb3fb28ae7f4ca70fca264bb7a981f3
5
- SHA512:
6
- metadata.gz: c598443d14f97c2f306f0be54d4c813d3f15d70b38045c5a10800dec0dcbb177e8768866eef2e525d2670c6d39d868edd7d9c9db9cbaef440d8b71093af99b53
7
- data.tar.gz: cc57c5802e7fc964f5c589442f76e8f65aa285683b297ca321f32b5a1c69726069be07bd9d86ba625c29e777a0e7ee56d671917f7a3413f3dd93daceee9b1fad