marfa 0.1.8 → 0.1.9

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: a777d031578dcff7a85bf3264c509d21586551d9
4
- data.tar.gz: b4690307d3915a21c4db20aa9035927fcd094d6f
3
+ metadata.gz: 45cd98b215a57b3fb81400092eba5a45b3fc3745
4
+ data.tar.gz: 58e2b86ae416f8f80ae847bbb03a20131ec6e1a1
5
5
  SHA512:
6
- metadata.gz: b0dd578a7013bbd5f3b6b27204b73caa56ffde015c06f76f62fd6065db914c4adc3f7dfbd072f75ab1aabeeb7a877698cfc8486b5eb6fd44d34bd98d18c81138
7
- data.tar.gz: e82ff2f99c26bfa94dbf1b5c6c4339554b250273e50b46642b1e26059923c559bcbd4bf0a5cf8b94124058bb193dfb292c0d981bd208f6d455503d02b2dc41cd
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
@@ -0,0 +1,6 @@
1
+ module Marfa
2
+ def self.css_version
3
+ @css_version ||= Time.now.to_i.freeze
4
+ end
5
+ # set / get ?
6
+ end
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.8' unless defined?(Marfa::VERSION)
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
@@ -16,6 +16,7 @@ require 'marfa/models/base_dto'
16
16
  require 'marfa/models/api_model'
17
17
  require 'marfa/models/db_model'
18
18
  require 'marfa/file_templates'
19
+ require 'marfa/css_version'
19
20
 
20
21
  # requires all submodules
21
22
  module Marfa
data/marfa.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'marfa'
6
- s.version = '0.1.8'
6
+ s.version = '0.1.9'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.date = Time.now.strftime('%Y-%m-%d')
9
9
  s.summary = 'Little Sinatra-based framework'
@@ -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.8
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-09 00:00:00.000000000 Z
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