volt 0.9.7.pre2 → 0.9.7.pre3

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: 25051871468c59824f6199f8656f30ebb31134a4
4
- data.tar.gz: 0a9d1c61f06188fd8395abbe62a05aa7535d297c
3
+ metadata.gz: 14f0e852a5a80c23450553604545cc05f2046713
4
+ data.tar.gz: 8714d6c8452571f7b556238f749504ac85bd0a4b
5
5
  SHA512:
6
- metadata.gz: ca789facecc7f76aaa5b2f92e2c8b900113d2b390cfa2a5aca6e771ad4dc3ff32659e578a8fba23bb3243dbc6e4061aad7d842374401dd181c77c46e26465537
7
- data.tar.gz: 40c1a6edf970b4eac77087023a4d2b94b420cd92b2d28b588e92b0ef70ab23c3080b59b9e6a785f74173924e09fb47dae0a16928e606a3f91390f5c76040a6ed
6
+ metadata.gz: e359ae0d0fea64290af10f8f08f59f5fe21bd5ec623f0ed8dfde2e2612e8f6915b85f2098b499436dd25f9f73dd63b2f7061abbbb5f6946e6ea54b2b59cbb07b
7
+ data.tar.gz: bcbe9de16828193c20085cbf3d953e003e6ce3e4ddcd0f9a9fe98c5987a6e29d9efb0c81bd26d2b061f71b72e7cae94550fc51bb5d7ab03a761c57fcd652d909
@@ -18,7 +18,8 @@ if RUBY_PLATFORM == 'opal'
18
18
  attr_reader :config
19
19
 
20
20
  # Called on page load to pass the backend config to the client
21
- def setup_client_config(config_hash)
21
+ def setup_client_config(env, config_hash)
22
+ self.env.env = env
22
23
  # Only Volt.config.public is passed from the server (for security reasons)
23
24
  @config = wrap_config(public: config_hash)
24
25
  end
@@ -13,7 +13,7 @@ module Volt
13
13
  end
14
14
 
15
15
  # Runs all migrations up
16
- def run(direction=:up, util_version=nil)
16
+ def run(direction=:up, until_version=nil)
17
17
  # Get the disk versions
18
18
  disk_version_paths = self.disk_versions
19
19
  disk_versions = disk_version_paths.map {|v| v[0] }
@@ -25,19 +25,19 @@ module Volt
25
25
  # Run all that are on disk, but haven't been run (from the db)
26
26
  need_to_run_versions = disk_versions - ran_versions
27
27
 
28
- if util_version
29
- # remove any versions > the util_version, since the user is saying run
28
+ if until_version
29
+ # remove any versions > the until_version, since the user is saying run
30
30
  # "up" migrations until we hit version X
31
- need_to_run_versions.reject! {|version| version > util_version }
31
+ need_to_run_versions.reject! {|version| version > until_version }
32
32
  end
33
33
  else
34
34
  # Run down on all versions that are in the db. If the file doesn't exist
35
35
  need_to_run_versions = ran_versions
36
36
 
37
- if util_version
38
- # remove any versions < the util_version, since the user is saying run
37
+ if until_version
38
+ # remove any versions < the until_version, since the user is saying run
39
39
  # "up" migrations until we hit version X
40
- need_to_run_versions.reject! {|version| version < util_version }
40
+ need_to_run_versions.reject! {|version| version < until_version }
41
41
  end
42
42
  end
43
43
 
@@ -31,7 +31,7 @@ module Volt
31
31
 
32
32
  def generate_config_code
33
33
  # Setup Volt.config on the client
34
- "\nVolt.setup_client_config(#{Volt.config.public.to_h.inspect})\n"
34
+ "\nVolt.setup_client_config(#{Volt.env.to_s.inspect}, #{Volt.config.public.to_h.inspect})\n"
35
35
  end
36
36
  end
37
37
  end
@@ -1,5 +1,5 @@
1
1
  module Volt
2
2
  module Version
3
- STRING = '0.9.7.pre2'
3
+ STRING = '0.9.7.pre3'
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  module Volt
2
2
  class Environment
3
+ attr_writer :env
3
4
  def initialize
4
5
  # Use VOLT_ENV or RACK_ENV to set the environment
5
6
  @env = ENV['VOLT_ENV'] || ENV['RACK_ENV']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7.pre2
4
+ version: 0.9.7.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout