grass 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/grass +1 -1
- data/lib/grass/cache.rb +9 -3
- data/lib/grass/version.rb +1 -1
- data/lib/templates/app/Rakefile +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80273e5b97f98a379386a4b02e0a7000c5654ccd
|
4
|
+
data.tar.gz: a2570cc82c8634690c0300ac65b231f9ae99fc14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba4d6c9828a89d9c6d8438e087dc5fb3ef12e61a7ac278e367af160767f8a4b4d2e769bced95c6b0eb925aa127a9f0a0e87d1c8a90cf9070faa625decf1b70cf
|
7
|
+
data.tar.gz: a7bbf7c2af4fcb8f638b5d69439418cde0eaa5cc3ee38f8893f8b9111c348136d7d156e43407e0d3a780c8faca3eae06d679a6578a0130bb9e5c67dba0ac1bdc
|
data/bin/grass
CHANGED
@@ -42,7 +42,7 @@ command :push do |c|
|
|
42
42
|
|
43
43
|
Grass.cache.flush
|
44
44
|
|
45
|
-
files.
|
45
|
+
files.keep_if{ |file| file =~ /\/assets|\/content|\/views/ }.each do |file|
|
46
46
|
|
47
47
|
unless File.directory?(file)
|
48
48
|
source = Grass::Source.find_or_create_by!(filepath: file)
|
data/lib/grass/cache.rb
CHANGED
@@ -1,16 +1,22 @@
|
|
1
1
|
module Grass
|
2
2
|
module Cache
|
3
3
|
|
4
|
-
DATA_CACHE_KEYS = %i(language_info country_info params http_host request_path)
|
5
|
-
|
6
4
|
module ClassMethods
|
7
5
|
|
6
|
+
def data_cache_keys
|
7
|
+
@@data_cache_keys ||= %i(language_info country_info params http_host request_path)
|
8
|
+
end
|
9
|
+
|
10
|
+
def data_cache_keys= keys
|
11
|
+
@@data_cache_keys = keys
|
12
|
+
end
|
13
|
+
|
8
14
|
def read_cache cache_key
|
9
15
|
JSON.load(Grass.cache.get(cache_key))
|
10
16
|
end
|
11
17
|
|
12
18
|
def generate_cachekey key_fullpath, data
|
13
|
-
Digest::MD5.hexdigest("#{key_fullpath}_#{data.select{|k,v|
|
19
|
+
Digest::MD5.hexdigest("#{key_fullpath}_#{data.select{|k,v| self.data_cache_keys.include?(k)}}")
|
14
20
|
end
|
15
21
|
|
16
22
|
end
|
data/lib/grass/version.rb
CHANGED
data/lib/templates/app/Rakefile
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../', __FILE__)
|
2
2
|
load "grass/tasks/db.rake"
|
3
3
|
desc "pushes deployed file changes"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
namespace :grass do
|
5
|
+
task :push do
|
6
|
+
system 'bundle exec grass push'
|
7
|
+
end
|
8
|
+
end
|