marfa 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -28
- data/lib/marfa/controllers/base_controller.rb +2 -0
- data/lib/marfa/css_version.rb +6 -0
- data/lib/marfa/version.rb +1 -1
- data/lib/marfa.rb +1 -0
- data/marfa.gemspec +1 -1
- data/spec/cache_spec.rb +50 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45cd98b215a57b3fb81400092eba5a45b3fc3745
|
4
|
+
data.tar.gz: 58e2b86ae416f8f80ae847bbb03a20131ec6e1a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64b579aef5a7e4bc797e1c9c22796f22cc5580c734347b492f5ef9d464e6771622451f100dbb3b782b27256eca8ff6eb47b75c68471ac2c7e14427bc615498ea
|
7
|
+
data.tar.gz: 8c1f8777121fb601255d502c91d65e041c19e7e907a3990a182234d69c91626f9d5270ed402eeda0c2f86394aed4c36bd825f864dfef1c5b32906aadea4a611d
|
data/Rakefile
CHANGED
@@ -79,31 +79,4 @@ task :transpile_js, [:home_path, :search_dir, :output_dir] do |t, args|
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
end
|
83
|
-
|
84
|
-
# task :compile_css, [:home_path, :search_dir, :output_dir] do |t, args|
|
85
|
-
# search_dir = args[:search_dir] || ''
|
86
|
-
# output_dir = args[:output_dir] || '/static/css'
|
87
|
-
#
|
88
|
-
# Dir[args[:home_path] + search_dir + '/**/*.scss'].each do |path|
|
89
|
-
# puts "Processing #{path}"
|
90
|
-
#
|
91
|
-
# output_path = args[:home_path] + output_dir
|
92
|
-
# mkdir_p(output_path) unless Dir.exist?(output_path)
|
93
|
-
#
|
94
|
-
# device_names.each do |device|
|
95
|
-
# full_path =
|
96
|
-
# output_path +
|
97
|
-
# '/' +
|
98
|
-
# path.split('/')
|
99
|
-
# .last
|
100
|
-
# .gsub('scss', '') +
|
101
|
-
# "#{device}.css"
|
102
|
-
#
|
103
|
-
# styles = create_style(path, device)
|
104
|
-
# File.write(full_path, styles)
|
105
|
-
# end
|
106
|
-
#
|
107
|
-
# end
|
108
|
-
#
|
109
|
-
# end
|
82
|
+
end
|
@@ -3,6 +3,7 @@ require 'rack/csrf'
|
|
3
3
|
require 'device_detector'
|
4
4
|
require 'marfa/helpers/controller'
|
5
5
|
require 'marfa/helpers/http/vary'
|
6
|
+
require 'marfa/css_version'
|
6
7
|
|
7
8
|
# Extending Marfa
|
8
9
|
module Marfa
|
@@ -12,6 +13,7 @@ module Marfa
|
|
12
13
|
class BaseController < Sinatra::Base
|
13
14
|
before do
|
14
15
|
@device = DeviceDetector.new(request.user_agent).device_type
|
16
|
+
@css_version = Marfa.css_version
|
15
17
|
end
|
16
18
|
|
17
19
|
# Not Found page
|
data/lib/marfa/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Version constant
|
2
2
|
module Marfa
|
3
3
|
# The version constant for the current version of Marfa
|
4
|
-
VERSION = '0.1.
|
4
|
+
VERSION = '0.1.9' unless defined?(Marfa::VERSION)
|
5
5
|
|
6
6
|
# The current Marfa version.
|
7
7
|
# @return [String] The version number
|
data/lib/marfa.rb
CHANGED
data/marfa.gemspec
CHANGED
data/spec/cache_spec.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'marfa/cache'
|
2
|
+
|
3
|
+
describe Marfa::Cache do
|
4
|
+
before(:all) do
|
5
|
+
@cache = Marfa::Cache.new
|
6
|
+
@key = 'cache_testing'
|
7
|
+
@value = { key: 'value' }
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'checks data setting' do
|
11
|
+
@cache.set(@key, @value)
|
12
|
+
expect(@cache.exist?(@key)).to be
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'checks data getting' do
|
16
|
+
data = @cache.get(@key)
|
17
|
+
expect(data).to be
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'checks data getting with wrong key' do
|
21
|
+
data = @cache.get('some_unknown_key')
|
22
|
+
expect(data).to be_nil
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'checks data deleting' do
|
26
|
+
@cache.delete(@key)
|
27
|
+
expect(@cache.exist?(@key)).to eql false
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'checks data deleting by pattern' do
|
31
|
+
@cache.set(@key, @value)
|
32
|
+
@cache.set(@key + '_1', @value)
|
33
|
+
@cache.delete_by_pattern('testing')
|
34
|
+
expect(@cache.exist?(@key)).to eql false
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'checks_create_cache_key' do
|
38
|
+
kind = 'block'
|
39
|
+
path = 'offer/list'
|
40
|
+
tags = %w(offers cities)
|
41
|
+
cache_key = @cache.create_key(kind, path, tags)
|
42
|
+
expect(cache_key.length).to satisfy { |len| len > 20 }
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'checks_create_json_cache_key' do
|
46
|
+
path = 'offer/list.json'
|
47
|
+
cache_key = @cache.create_json_key(path)
|
48
|
+
expect(cache_key.length).to eql path.length
|
49
|
+
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Krechetov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-02-
|
13
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: haml
|
@@ -286,6 +286,7 @@ files:
|
|
286
286
|
- lib/marfa/controllers.rb
|
287
287
|
- lib/marfa/controllers/base_controller.rb
|
288
288
|
- lib/marfa/controllers/css_controller.rb
|
289
|
+
- lib/marfa/css_version.rb
|
289
290
|
- lib/marfa/file_templates.rb
|
290
291
|
- lib/marfa/helpers/classes/string.rb
|
291
292
|
- lib/marfa/helpers/controller.rb
|
@@ -299,6 +300,7 @@ files:
|
|
299
300
|
- lib/marfa/models/db_model.rb
|
300
301
|
- lib/marfa/version.rb
|
301
302
|
- marfa.gemspec
|
303
|
+
- spec/cache_spec.rb
|
302
304
|
homepage: http://rubygems.org/gems/marfa
|
303
305
|
licenses:
|
304
306
|
- MIT
|