rails-lineman 0.0.2 → 0.0.3

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: 0c8113d485ea10ec81911a937c61c491b3b5f93c
4
- data.tar.gz: a9cf0710d4a806f87fe12af899e9bf03cf004968
3
+ metadata.gz: f5f398811b6de1d755c12fdafa6d7a5df86da3a7
4
+ data.tar.gz: 6bf56a4a977f8eb8b98abdbb8b3c1141f8d67f26
5
5
  SHA512:
6
- metadata.gz: 66e15c3476e16b121dd3c60b54d1a60995f69972ab3ee6fa1c6c4d004f4c7c668d3e87c689b56abf8ac07bdc52e101183adcc2c0f523bfd3329308ad67687fc6
7
- data.tar.gz: 04e4477818e3e1543deab05e42617476bb6104968341399b9d927d510b910ab4911b4ca1e343655c21d030746a315a28fd32a3ecff6e465266238359ac70a6a3
6
+ metadata.gz: 41ccbd2499bbe3b752ff5b0e9834b658b7e2153c8c013c75ac3430a96c1f611b73985ebcfe5b3e3abb633898db9b1ab825bdad157e3a349651404700ed1e6b16
7
+ data.tar.gz: 57e4dcd0be904bec205f9ca2dffa40ba132a0481a9c58102f227aecc15c277b67d417661b1c1aff7e5218e27ffd1f1377356c4d805285ed12d7cce72aab5df28
@@ -5,8 +5,11 @@ module RailsLineman
5
5
  class LinemanDoer
6
6
  def initialize(config)
7
7
  @lineman_project_location = config.lineman_project_location
8
+ @javascripts_source = File.join(@lineman_project_location, "dist", "js", ".")
8
9
  @javascripts_destination = Rails.root.join(config.javascripts_destination)
10
+ @stylesheets_source = File.join(@lineman_project_location, "dist", "css", ".")
9
11
  @stylesheets_destination = Rails.root.join(config.stylesheets_destination)
12
+ @tmp_dir = Rails.root.join(config.tmp_dir)
10
13
  @remove_lineman_assets_after_asset_pipeline_precompilation = config.remove_lineman_assets_after_asset_pipeline_precompilation
11
14
  end
12
15
 
@@ -18,6 +21,7 @@ module RailsLineman
18
21
  run_lineman_build
19
22
  delete_node_js_from_heroku
20
23
  end
24
+ ensure_directories_exist
21
25
  copy_javascripts
22
26
  add_javascripts_to_precompile_list
23
27
  copy_stylesheets
@@ -28,6 +32,7 @@ module RailsLineman
28
32
  return unless @remove_lineman_assets_after_asset_pipeline_precompilation
29
33
  delete_javascripts
30
34
  delete_stylesheets
35
+ delete_tmp_dir
31
36
  end
32
37
 
33
38
  private
@@ -106,8 +111,14 @@ module RailsLineman
106
111
  system "rm -rf heroku_node_install" if heroku?
107
112
  end
108
113
 
114
+ def ensure_directories_exist
115
+ ([@javascripts_source, @javascripts_destination, @stylesheets_source, @stylesheets_destination]).each do |path|
116
+ FileUtils.mkdir_p(path)
117
+ end
118
+ end
119
+
109
120
  def copy_javascripts
110
- FileUtils.cp_r(File.join(@lineman_project_location, "dist", "js"), @javascripts_destination)
121
+ FileUtils.cp_r(@javascripts_source, @javascripts_destination)
111
122
  end
112
123
 
113
124
  def add_javascripts_to_precompile_list
@@ -115,7 +126,7 @@ module RailsLineman
115
126
  end
116
127
 
117
128
  def copy_stylesheets
118
- FileUtils.cp_r(File.join(@lineman_project_location, "dist", "css"), @stylesheets_destination)
129
+ FileUtils.cp_r(@stylesheets_source, @stylesheets_destination)
119
130
  end
120
131
 
121
132
  def add_stylesheets_to_precompile_list
@@ -130,5 +141,9 @@ module RailsLineman
130
141
  FileUtils.rm_rf(@stylesheets_destination)
131
142
  end
132
143
 
144
+ def delete_tmp_dir
145
+ FileUtils.rm_rf(@tmp_dir)
146
+ end
147
+
133
148
  end
134
149
  end
@@ -3,12 +3,19 @@ module RailsLineman
3
3
  config.rails_lineman = ActiveSupport::OrderedOptions.new
4
4
 
5
5
  config.rails_lineman.lineman_project_location = ENV['LINEMAN_PROJECT_LOCATION']
6
- config.rails_lineman.javascripts_destination = File.join("app", "assets","javascripts", "lineman")
7
- config.rails_lineman.stylesheets_destination = File.join("app", "assets","stylesheets", "lineman")
6
+ config.rails_lineman.javascripts_destination = File.join("tmp", "rails_lineman", "lineman")
7
+ config.rails_lineman.stylesheets_destination = File.join("tmp", "rails_lineman", "lineman")
8
8
  config.rails_lineman.remove_lineman_assets_after_asset_pipeline_precompilation = true
9
9
 
10
+ config.rails_lineman.tmp_dir = File.join("tmp", "rails_lineman")
11
+ config.rails_lineman.asset_paths = [ config.rails_lineman.tmp_dir ]
12
+
10
13
  rake_tasks do
11
14
  load(File.join(File.dirname(__FILE__), '..', 'tasks', 'assets_precompile.rake'))
12
15
  end
16
+
17
+ initializer "rails_jasmine.add_asset_paths" do
18
+ Rails.application.config.assets.paths |= config.rails_lineman.asset_paths.map { |path| Rails.root.join(path) }
19
+ end
13
20
  end
14
21
  end
@@ -1,3 +1,3 @@
1
1
  module RailsLineman
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -5,9 +5,12 @@ require 'rails_lineman/lineman_doer'
5
5
  namespace :assets do
6
6
  desc 'Compile all the assets named in config.assets.precompile (Wrapped by rails-lineman)'
7
7
  RailsLineman::TaskHelpers.override_task :precompile => :environment do
8
- lineman_doer = RailsLineman::LinemanDoer.new(Rails.application.config.rails_lineman)
9
- lineman_doer.build
10
- Rake::Task["assets:precompile:original"].execute
11
- lineman_doer.destroy
8
+ begin
9
+ lineman_doer = RailsLineman::LinemanDoer.new(Rails.application.config.rails_lineman)
10
+ lineman_doer.build
11
+ Rake::Task["assets:precompile:original"].execute
12
+ ensure
13
+ lineman_doer.destroy
14
+ end
12
15
  end
13
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-lineman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-21 00:00:00.000000000 Z
11
+ date: 2013-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake