rails_blocks 0.7.11 → 0.8.1

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
  SHA256:
3
- metadata.gz: 98997bf17ad7da0d3352b7e34d658bcc93fe9354a3fa2d6a9b9e2f098fdec175
4
- data.tar.gz: a85a23ac0a5238468e3c65cf027f3be4acf603b1339a84e2ebcb0251c6b915ed
3
+ metadata.gz: eb776741563cf39110602da7ffc497ffd2c736318680605de378c6e0d3380fa9
4
+ data.tar.gz: 0336f186612c4cb4f8eafaa9f03ed8018d9a7a6ddc57d7f4617bad359063fd98
5
5
  SHA512:
6
- metadata.gz: 816b8b7aec4a7b6f6cb16f1101affb821c2889de7d6f09d87f7c7cb144fae874537ab8a5ae1feeaac8765bc2238b0b4e9d2a8d45f3bd4dbea379baf36e70afce
7
- data.tar.gz: 1cc959e2530a6a10150e0e1e6d1c5543dbacb4704884dfa8fe01cce060aeb926a68970953f720001d83504ec6664764098b0e22aa221543ff075c3dd54c2a7e9
6
+ metadata.gz: 2ef7424334bd1c1cac0c0097f52f1ddf5dfe93309f38630a988423301bd01e214c2948384a3f0b892626f5149923cc25fd0535252bc245c021619517c7af1458
7
+ data.tar.gz: 8696b7e04d9c3a8b065f373b9e0187c09ff7c48bd7c092db44eb5d7816f881ffb5b3754fdc4ec23442939d2af69aba9835a0c4fbcb46661bfb51cb1e7703ef43
@@ -26,6 +26,12 @@ $ ->
26
26
  else
27
27
  return @hasClass($$.blockModClass(@b_name, name, value))
28
28
 
29
+ toggleMod: (mod, value) ->
30
+ if @hasMod(mod, value)
31
+ @delMod(mod, value)
32
+ else
33
+ @addMod(mod, value)
34
+
29
35
  delMod: (name, value) ->
30
36
  if @isElem()
31
37
  @removeClass($$.elementModClass(@b_name, @e_name, name, value))
@@ -70,7 +70,8 @@ module BlockHelper
70
70
  @attrs = nil
71
71
  @current_options = options
72
72
  @current_entity = {type: type, name: name}
73
- template.nil? ? empty(content) : render(file: template, locals: {content: content, options: options})
73
+ p template
74
+ template.nil? ? empty(content) : render(template: template, locals: {content: content, options: options})
74
75
  end
75
76
 
76
77
  def empty(content)
@@ -10,12 +10,14 @@ module RailsBlocks
10
10
  end
11
11
 
12
12
  def self.tree
13
- #so slow, переделать на оновление при запросе, а не каждый раз
14
- #return build_tree if Rails.env.development?
15
13
  @tree ||= (
16
14
  build_tree
17
15
  )
18
16
  end
17
+
18
+ def self.reload_tree
19
+ @tree = build_tree
20
+ end
19
21
 
20
22
  def self.blocks_dir
21
23
  Rails.root.join RailsBlocks.config.blocks_dir
@@ -64,8 +66,12 @@ module RailsBlocks
64
66
  files = Dir["#{blocks_dir}/**/*#{RailsBlocks.config.template_engine}"]
65
67
  files.each do |file|
66
68
  file.sub! blocks_dir.to_s + '/', ''
69
+ file.sub! '.html' + RailsBlocks.config.template_engine, ''
70
+
67
71
  parts = file.split('/')
68
- filename = parts[2].sub RailsBlocks.config.template_engine, ''
72
+ filename = File.basename(file, RailsBlocks.config.template_engine)
73
+ filename = File.basename(filename, '.html')
74
+ p filename
69
75
  template = {
70
76
  level: parts[0],
71
77
  block: parts[1],
@@ -1,3 +1,3 @@
1
1
  module RailsBlocks
2
- VERSION = "0.7.11".freeze
2
+ VERSION = "0.8.1".freeze
3
3
  end
data/lib/rails_blocks.rb CHANGED
@@ -21,4 +21,8 @@ module RailsBlocks
21
21
  def self.reset
22
22
  @config = Configuration.new
23
23
  end
24
+
25
+ def self.reload_tree
26
+
27
+ end
24
28
  end
Binary file
data/rails_blocks.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'rails', '~> 5.0'
21
+ spec.add_dependency 'rails', ">= 5.2", "< 7.1"
22
22
  #testing
23
23
  spec.add_development_dependency 'combustion', '~> 0.5.5'
24
24
  spec.add_development_dependency 'bundler', '~> 1.7'
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_blocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.11
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Potetiurin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-07 00:00:00.000000000 Z
11
+ date: 2023-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '5.2'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '5.0'
22
+ version: '7.1'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '5.2'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '5.0'
32
+ version: '7.1'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: combustion
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -175,6 +181,7 @@ files:
175
181
  - lib/rails_blocks/path.rb
176
182
  - lib/rails_blocks/version.rb
177
183
  - lib/tasks/rails_blocks.rake
184
+ - rails_blocks-0.7.11.gem
178
185
  - rails_blocks.gemspec
179
186
  - spec/helpers/block_helper_spec.rb
180
187
  - spec/internal/app/blocks/app/block3/_mod1.slim
@@ -224,8 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
231
  - !ruby/object:Gem::Version
225
232
  version: '0'
226
233
  requirements: []
227
- rubyforge_project:
228
- rubygems_version: 2.7.7
234
+ rubygems_version: 3.4.15
229
235
  signing_key:
230
236
  specification_version: 4
231
237
  summary: Rails plugin for work with some modification of BEM methodology