luban-rails 0.1.3 → 0.1.4

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: b174bdb04f91c5d019ef52d0a78e33acfb6f59ea
4
- data.tar.gz: 3547e69537a2a81d1a66dca483bf3b53f4d690cd
3
+ metadata.gz: da8e14d17703cf739c2fc2c843b7ebcfd349843d
4
+ data.tar.gz: d98f9b0a04155a1ac84c10cd56b3d095d86f53e0
5
5
  SHA512:
6
- metadata.gz: 182bf4d8b43b3035a76e85ba2b17332096d28f03026428fce803571aa6c85e152763765360e8a8f24c28d52b92864b0df05d1e242fd85899a0b5d59fa9cfff26
7
- data.tar.gz: fbc18e217dad045d0f4cc2b6cee35b6d073c51573b24e809c4f14dcbfbb96765a39c336601912f4934b344bf3fcba506d44b7a6e6db7ed45c44de67e00e3273c
6
+ metadata.gz: a6814a6a85601a71fb9846be1ded6fdfe40952eb241e5e0a6e99cbfef2d291cfea97df58133fef1b2b1deeb9dc8eb296c38afa155453c5ee2126cf38edce66c5
7
+ data.tar.gz: 7ca64200457749d76ba98640c6880a04849ddcc4f36b6426702d3813e7216ab9d7c9b7cad27aec1b01521eb002b8b496f2c7a0aa8bca39d9d132af2a9ee9a8a4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.1.4 (Sept 04, 2016)
4
+
5
+ Minor enhancements:
6
+ * Extended support for assets precompilation
7
+ * Added parameter #assets_precompile to turn on/off assets precompilation
8
+ * Checked rails version (>=3.1) before assets precompilation starts
9
+
3
10
  ## Version 0.1.3 (Sept 01, 2016)
4
11
 
5
12
  Minor enhancements:
@@ -4,8 +4,27 @@ module Luban
4
4
  module Deployment
5
5
  module Applications
6
6
  class Rails < Luban::Deployment::Applications::Rack
7
+ module Parameters
8
+ extend Luban::Deployment::Parameters::Base
9
+
10
+ parameter :assets_precompile
11
+
12
+ protected
13
+
14
+ def set_default_rails_parameters
15
+ set_default :assets_precompile, true
16
+ end
17
+ end
18
+
19
+ include Parameters
20
+
7
21
  protected
8
22
 
23
+ def set_default_application_parameters
24
+ super
25
+ set_default_rails_parameters
26
+ end
27
+
9
28
  def include_default_templates_path
10
29
  super
11
30
  default_templates_paths.unshift(base_templates_path(__FILE__))
@@ -3,13 +3,23 @@ module Luban
3
3
  module Applications
4
4
  class Rails
5
5
  class Publisher < Luban::Deployment::Applications::Rack::Publisher
6
+ include Parameters
7
+
6
8
  def shell_command_prefix
7
9
  @shell_command_prefix ||= super.unshift("RAILS_ENV=#{stage}")
8
10
  end
9
11
 
12
+ def rails_version
13
+ capture(compose_command("rails --version")).gsub('Rails ', '')
14
+ end
15
+
16
+ def rails_version_match?(version)
17
+ Gem::Requirement.new(version).satisfied_by?(Gem::Version.new(rails_version))
18
+ end
19
+
10
20
  def after_publish
11
21
  super
12
- publish_assets! if publish_app?
22
+ publish_assets! if publish_app? and assets_precompile and rails_version_match?(">=3.1")
13
23
  end
14
24
 
15
25
  protected
@@ -2,7 +2,7 @@ module Luban
2
2
  module Deployment
3
3
  module Applications
4
4
  class Rails
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Chi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-01 00:00:00.000000000 Z
11
+ date: 2016-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban