volt 0.9.7.pre2 → 0.9.7.pre3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14f0e852a5a80c23450553604545cc05f2046713
|
4
|
+
data.tar.gz: 8714d6c8452571f7b556238f749504ac85bd0a4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e359ae0d0fea64290af10f8f08f59f5fe21bd5ec623f0ed8dfde2e2612e8f6915b85f2098b499436dd25f9f73dd63b2f7061abbbb5f6946e6ea54b2b59cbb07b
|
7
|
+
data.tar.gz: bcbe9de16828193c20085cbf3d953e003e6ce3e4ddcd0f9a9fe98c5987a6e29d9efb0c81bd26d2b061f71b72e7cae94550fc51bb5d7ab03a761c57fcd652d909
|
data/lib/volt/config.rb
CHANGED
@@ -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,
|
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
|
29
|
-
# remove any versions > the
|
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 >
|
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
|
38
|
-
# remove any versions < the
|
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 <
|
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
|
data/lib/volt/version.rb
CHANGED