linner 0.8.7 → 0.9.0

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: 99ac3be13249f3a3e3ff674538df5b16d45e8b3d
4
- data.tar.gz: fcb79fcbc3c710833afecb5ba8bb6cbae8558a8f
3
+ metadata.gz: fa68b40bdac8138c5f45acec8b4ab237df0afa14
4
+ data.tar.gz: 669592b1f067ba5ecd1193dd27b3b2086c140f0e
5
5
  SHA512:
6
- metadata.gz: be4eb198984459e6fd569dc6d69bdf01f82ff814d305d2f32549e97b29ea5cc679736ccd25b624d4e0feafbbeea30180b7b20061ae79734d9a1dffa9a10ffb45
7
- data.tar.gz: 2676fb77d975e4a34f5e3c9cfcdb4f1d310f03769f7207cc5b4f07663966a444641817c8667a3b8bd326f72924bf17148548be9e48c62af22c725a3c5c5f67d1
6
+ metadata.gz: be8e4f4aa8d63e784d7f199bbe1ef7026de9c05299b10be573a019144ae7490cbabd8ae51d0b7f2f547a621904cd2d6534fd137a9315eb9b33343b785a396a79
7
+ data.tar.gz: 21b98ea25084344e16c884877b85980d778e8fb06dbc329df5146efcbf27577cd89a94f666c824db3bf03140ae213278fdccd9b2ef2b6479fd2686fca2a7bc74
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.9.0
2
+ - introducing environment for different environments
3
+
1
4
  v0.8.7
2
5
  - support CDN in revision plugin
3
6
 
@@ -108,7 +108,7 @@ Default:
108
108
  ```yaml
109
109
  revision:
110
110
  prefix: "/public"
111
- cdn: "http://assets.yoursite.com"
111
+ cdn: http://assets.yoursite.com
112
112
  manifest: "manifest.yml"
113
113
  files:
114
114
  - "index.html"
@@ -161,3 +161,28 @@ bundles:
161
161
  bundles also supports `tar.gz` file on the internet, you should give it a try.
162
162
 
163
163
  When you use `tar.gz` file, the key of bundle can be a folder name, all the archived files will be decompression to the folder.
164
+
165
+
166
+ ## `environments`
167
+
168
+ `environments` defines application's running environment config, the default environment is `development`.
169
+
170
+ If you use `linner build` to build your webapp, the environment would be `production`.
171
+
172
+ For example:
173
+
174
+ ```yaml
175
+ environments:
176
+ staging:
177
+ revision:
178
+ cdn: http://staging.yoursite.com
179
+ production:
180
+ revision:
181
+ cdn: http://production.yoursite.com
182
+ ```
183
+
184
+ You can use `linner build -e staging` to use the staging environment's variables.
185
+
186
+ When you use `linner watch` to watch the project, it's equals to `linner watch -e development`, and the `development` environment is the default environment, you don't need to write it.
187
+
188
+ When you use `linner build` to build the project, it's equals to `linner build -e produciton`.
@@ -16,14 +16,26 @@ module Linner
16
16
  end
17
17
 
18
18
  desc "check", "check dependencies"
19
+ method_option :environment,
20
+ type: :string,
21
+ default: "development",
22
+ aliases: "-e",
23
+ desc: "Watch the choosen environment"
19
24
  def check
25
+ env.merge_with_environment(options[:environment])
20
26
  message = Linner::Bundler.new(env).check
21
27
  puts (message.first ? "🍵 :" : "👻 :") + message.last
22
28
  end
23
29
 
24
30
  desc "install", "install dependencies"
31
+ method_option :environment,
32
+ type: :string,
33
+ default: "development",
34
+ aliases: "-e",
35
+ desc: "Watch the choosen environment"
25
36
  def install
26
37
  begin
38
+ env.merge_with_environment(options[:environment])
27
39
  Linner::Bundler.new(env).perform
28
40
  rescue
29
41
  puts "👻 : Install failed!"
@@ -39,17 +51,29 @@ module Linner
39
51
  default: false,
40
52
  aliases: "-s",
41
53
  desc: "Use strict mode to replace revisiton."
54
+ method_option :environment,
55
+ type: :string,
56
+ default: "production",
57
+ aliases: "-e",
58
+ desc: "Build the choosen environment"
42
59
  def build
43
60
  Linner.compile = true
44
61
  Linner.strict = true if options[:strict]
45
62
  clean
63
+ env.merge_with_environment(options[:environment])
46
64
  Bundler.new(env).perform
47
65
  perform
48
66
  end
49
67
 
50
68
  desc "watch", "watch assets"
69
+ method_option :environment,
70
+ type: :string,
71
+ default: "development",
72
+ aliases: "-e",
73
+ desc: "Watch the choosen environment"
51
74
  def watch
52
75
  clean
76
+ env.merge_with_environment(options[:environment])
53
77
  Bundler.new(env).perform
54
78
  perform
55
79
  watch_for_env
@@ -58,6 +58,15 @@ module Linner
58
58
  @env["groups"].values
59
59
  end
60
60
 
61
+ def environments
62
+ @env["environments"] || {}
63
+ end
64
+
65
+ def merge_with_environment(environment)
66
+ return @env unless picked = environments[environment]
67
+ @env = @env.rmerge!(picked)
68
+ end
69
+
61
70
  private
62
71
  def merge_with_convension
63
72
  convension = YAML::load File.read(File.join File.dirname(__FILE__), "../../vendor", "config.default.yml")
@@ -38,11 +38,6 @@ modules:
38
38
  sprites:
39
39
  path: /images/
40
40
  selector: .icon-
41
- revision:
42
- prefix: ""
43
- manifest: "manifest.yml"
44
- files:
45
- - index.html
46
41
  notification: true
47
42
  bundles:
48
43
  jquery.js:
@@ -51,3 +46,9 @@ bundles:
51
46
  handlebars.js:
52
47
  version: 1.0.0
53
48
  url: https://raw.github.com/wycats/handlebars.js/1.0.0/dist/handlebars.runtime.js
49
+ environments:
50
+ production:
51
+ revision:
52
+ manifest: "manifest.yml"
53
+ files:
54
+ - index.html
@@ -1,3 +1,3 @@
1
1
  module Linner
2
- VERSION = "0.8.7"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-17 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor