bemer 0.1.0 → 0.2.0

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.
Files changed (95) hide show
  1. checksums.yaml +5 -5
  2. data/{LICENSE-RU → LICENSE-RU.txt} +0 -0
  3. data/{LICENSE → LICENSE.txt} +5 -5
  4. data/README.md +47 -16
  5. data/docs/BEMHTML.md +5 -0
  6. data/docs//320/232/320/276/320/275/321/202/320/265/320/272/321/201/321/202-/321/203/320/267/320/273/320/260.md +275 -0
  7. data/docs//320/232/320/276/320/275/321/204/320/270/320/263/321/203/321/200/320/260/321/206/320/270/321/217.md +158 -0
  8. data/docs//320/237/321/200/320/265/320/264/320/270/320/272/320/260/321/202/321/213.md +205 -0
  9. data/docs//320/240/320/265/320/266/320/270/320/274/321/213.md +274 -0
  10. data/docs//320/241/320/276/320/267/320/264/320/260/320/275/320/270/320/265-/320/270-/320/270/321/201/320/277/320/276/320/273/321/214/320/267/320/276/320/262/320/260/320/275/320/270/320/265-UI-/320/272/320/276/320/274/320/277/320/276/320/275/320/265/320/275/321/202.md +173 -0
  11. data/docs//320/244/320/260/320/270/314/206/320/273/320/276/320/262/320/260/321/217-/321/201/321/202/321/200/321/203/320/272/321/202/321/203/321/200/320/260.md +167 -0
  12. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-bem_mix.md +62 -0
  13. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-bem_mods.md +63 -0
  14. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-block_tag.md +215 -0
  15. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-component_asset_path.md +71 -0
  16. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-component_pack.md +101 -0
  17. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-component_partial_path.md +28 -0
  18. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-define_component.md +154 -0
  19. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-define_templates.md +96 -0
  20. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-elem_tag.md +38 -0
  21. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-refine_component.md +114 -0
  22. data/docs//320/245/320/265/320/273/320/277/320/265/321/200-render_component.md +108 -0
  23. data/docs//320/250/320/260/320/261/320/273/320/276/320/275/321/213.md +44 -0
  24. data/lib/bemer.rb +3 -1
  25. data/lib/bemer/builders.rb +8 -0
  26. data/lib/bemer/builders/tree.rb +0 -8
  27. data/lib/bemer/configuration.rb +3 -1
  28. data/lib/bemer/context_extentions/structure.rb +2 -3
  29. data/lib/bemer/entity.rb +2 -2
  30. data/lib/bemer/entity_builder.rb +5 -9
  31. data/lib/bemer/helpers.rb +10 -0
  32. data/lib/bemer/mixin_list.rb +1 -1
  33. data/lib/bemer/modifier_list.rb +2 -2
  34. data/lib/bemer/path_resolver.rb +23 -0
  35. data/lib/bemer/pipeline/handler.rb +4 -6
  36. data/lib/bemer/railtie.rb +22 -9
  37. data/lib/bemer/renderer.rb +1 -1
  38. data/lib/bemer/template_list.rb +2 -4
  39. data/lib/bemer/tree.rb +3 -3
  40. data/lib/bemer/tree/node.rb +5 -7
  41. data/lib/bemer/version.rb +1 -1
  42. data/spec/bemer/railtie_spec.rb +95 -0
  43. data/spec/dummy/config/application.rb +30 -12
  44. data/spec/dummy/config/initializers/backtrace_silencers.rb +1 -5
  45. data/spec/dummy/config/initializers/bemer.rb +1 -3
  46. data/spec/rails_helper.rb +5 -9
  47. metadata +87 -129
  48. data/.gitignore +0 -17
  49. data/.overcommit.yml +0 -59
  50. data/.rspec +0 -4
  51. data/.rubocop.yml +0 -21
  52. data/.rubocop_todo.yml +0 -11
  53. data/Gemfile +0 -12
  54. data/Rakefile +0 -12
  55. data/bemer.gemspec +0 -43
  56. data/spec/dummy/Rakefile +0 -8
  57. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  58. data/spec/dummy/app/helpers/application_helper.rb +0 -4
  59. data/spec/dummy/app/jobs/application_job.rb +0 -4
  60. data/spec/dummy/app/mailers/application_mailer.rb +0 -6
  61. data/spec/dummy/app/models/application_record.rb +0 -5
  62. data/spec/dummy/app/models/concerns/.keep +0 -0
  63. data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
  64. data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
  65. data/spec/dummy/bin/bundle +0 -5
  66. data/spec/dummy/bin/rails +0 -6
  67. data/spec/dummy/bin/rake +0 -6
  68. data/spec/dummy/bin/setup +0 -39
  69. data/spec/dummy/bin/update +0 -31
  70. data/spec/dummy/bin/yarn +0 -13
  71. data/spec/dummy/config/cable.yml +0 -10
  72. data/spec/dummy/config/database.yml +0 -25
  73. data/spec/dummy/config/environments/development.rb +0 -51
  74. data/spec/dummy/config/environments/production.rb +0 -84
  75. data/spec/dummy/config/environments/test.rb +0 -44
  76. data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -7
  77. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -7
  78. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -6
  79. data/spec/dummy/config/initializers/inflections.rb +0 -17
  80. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  81. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -16
  82. data/spec/dummy/config/locales/en.yml +0 -33
  83. data/spec/dummy/config/puma.rb +0 -58
  84. data/spec/dummy/config/routes.rb +0 -5
  85. data/spec/dummy/config/secrets.yml +0 -32
  86. data/spec/dummy/config/spring.rb +0 -8
  87. data/spec/dummy/lib/assets/.keep +0 -0
  88. data/spec/dummy/log/.keep +0 -0
  89. data/spec/dummy/package.json +0 -5
  90. data/spec/dummy/public/404.html +0 -67
  91. data/spec/dummy/public/422.html +0 -67
  92. data/spec/dummy/public/500.html +0 -66
  93. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  94. data/spec/dummy/public/apple-touch-icon.png +0 -0
  95. data/spec/dummy/public/favicon.ico +0 -0
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- pkg/*
2
- *.gem
3
- .bundle
4
- log/*.log
5
-
6
- spec/dummy/db/*.sqlite3
7
- spec/dummy/db/*.sqlite3-journal
8
- spec/dummy/log/*.log
9
- spec/dummy/tmp/
10
-
11
- .ruby-version
12
- .ruby-gemset
13
-
14
- .DS_Store
15
- *.swp
16
- *.swo
17
- *~
@@ -1,59 +0,0 @@
1
- # Use this file to configure the Overcommit hooks you wish to use. This will
2
- # extend the default configuration defined in:
3
- # https://github.com/brigade/overcommit/blob/master/config/default.yml
4
- #
5
- # At the topmost level of this YAML file is a key representing type of hook
6
- # being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
7
- # customize each hook, such as whether to only run it on certain files (via
8
- # `include`), whether to only display output if it fails (via `quiet`), etc.
9
- #
10
- # For a complete list of hooks, see:
11
- # https://github.com/brigade/overcommit/tree/master/lib/overcommit/hook
12
- #
13
- # For a complete list of options that you can use to customize hooks, see:
14
- # https://github.com/brigade/overcommit#configuration
15
-
16
- gemfile: Gemfile
17
-
18
- CommitMsg:
19
- HardTabs:
20
- enabled: true
21
-
22
- RussianNovel:
23
- enabled: true
24
-
25
- PreCommit:
26
- BundleAudit:
27
- enabled: true
28
- flags:
29
- # Update the ruby-advisory-db and check Gemfile.lock
30
- - '--update'
31
-
32
- BundleCheck:
33
- enabled: true
34
-
35
- ExecutePermissions:
36
- enabled: true
37
- exclude:
38
- - 'spec/dummy/bin/*'
39
-
40
- Fasterer:
41
- enabled: true
42
-
43
- ForbiddenBranches:
44
- enabled: true
45
- branch_patterns:
46
- - 'master'
47
-
48
- HardTabs:
49
- enabled: true
50
-
51
- RuboCop:
52
- enabled: true
53
-
54
- TrailingWhitespace:
55
- enabled: true
56
-
57
- PrePush:
58
- RSpec:
59
- enabled: true
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --color
2
- --require spec_helper
3
- --format documentation
4
- --warnings
@@ -1,21 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- require: rubocop-rspec
4
-
5
- AllCops:
6
- TargetRubyVersion: 2.2
7
- DisplayCopNames: true
8
-
9
- Metrics/LineLength:
10
- Max: 100
11
- IgnoredPatterns:
12
- - '^\s*#'
13
- Exclude:
14
- - 'spec/**/*'
15
-
16
- Metrics/BlockLength:
17
- Exclude:
18
- - 'spec/**/*'
19
-
20
- Style/FrozenStringLiteralComment:
21
- EnforcedStyle: always
@@ -1,11 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2018-03-01 16:43:54 +0700 using RuboCop version 0.52.1.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 31
10
- Style/Documentation:
11
- Enabled: false
data/Gemfile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in bemer.gemspec
6
- gemspec
7
-
8
- group :development do
9
- # Auto-reload require files or local gems without restarting server during Rails development.
10
- gem 'require_reloader', '~> 0.2.1', git: 'https://github.com/vill/require_reloader.git',
11
- branch: 'bugfix/delete-watchable-gems'
12
- end
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
-
5
- begin
6
- require 'rspec/core/rake_task'
7
-
8
- RSpec::Core::RakeTask.new(:spec)
9
-
10
- task default: :spec
11
- rescue LoadError # rubocop:disable Lint/HandleExceptions
12
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path('../lib', __FILE__)
4
-
5
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
-
7
- require 'bemer/version'
8
-
9
- Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
10
- spec.name = 'bemer'
11
- spec.version = Bemer::VERSION
12
- spec.author = 'Alexander Grigorev'
13
- spec.email = 'vill@rubyinventory.org'
14
- # rubocop:disable Metrics/LineLength
15
- spec.summary = 'Build reusable UI components for Rails applications using the BEM methodology.'
16
- spec.description = 'Build reusable UI components for Rails applications using the BEM methodology.'
17
- # rubocop:enable Metrics/LineLength
18
- spec.homepage = 'https://github.com/vill/bemer'
19
- spec.license = 'MIT'
20
- spec.require_paths = ['lib']
21
- spec.test_files = `git ls-files -z -- spec/*`.split("\x0")
22
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
23
- f.match(%r{^spec/|^Gemfile.lock$})
24
- end
25
-
26
- spec.required_ruby_version = '>= 2.2.0'
27
- spec.required_rubygems_version = '>= 2.2.0'
28
-
29
- spec.add_development_dependency 'bundler', '~> 1.15'
30
- spec.add_development_dependency 'bundler-audit', '~> 0.6.0'
31
- spec.add_development_dependency 'fasterer', '~> 0.3.2'
32
- spec.add_development_dependency 'overcommit', '~> 0.41.0'
33
- spec.add_development_dependency 'rails', '~> 5.1.4'
34
- spec.add_development_dependency 'rake', '~> 12.3.0'
35
- spec.add_development_dependency 'require_reloader', '~> 0.2.1'
36
- spec.add_development_dependency 'rspec', '~> 3.7.0'
37
- spec.add_development_dependency 'rspec-rails', '~> 3.7.2'
38
- spec.add_development_dependency 'rubocop', '~> 0.52.1'
39
- spec.add_development_dependency 'rubocop-rspec', '~> 1.21'
40
- spec.add_development_dependency 'sqlite3', '~> 1.3.13'
41
-
42
- spec.add_runtime_dependency 'railties', '>= 3.2.22', '<= 5.2'
43
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Add your own tasks in files placed in lib/tasks ending in .rake,
4
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
5
-
6
- require_relative 'config/application'
7
-
8
- Rails.application.load_tasks
File without changes
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApplicationHelper
4
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationJob < ActiveJob::Base
4
- end
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationMailer < ActionMailer::Base
4
- default from: 'from@example.com'
5
- layout 'mailer'
6
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationRecord < ActiveRecord::Base
4
- self.abstract_class = true
5
- end
File without changes
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <style>
6
- /* Email styles need to be inline */
7
- </style>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>
@@ -1 +0,0 @@
1
- <%= yield %>
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
- load Gem.bin_path('bundler', 'bundle')
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- APP_PATH = File.expand_path('../config/application', __dir__)
5
- require_relative '../config/boot'
6
- require 'rails/commands'
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative '../config/boot'
5
- require 'rake'
6
- Rake.application.run
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'pathname'
5
- require 'fileutils'
6
- include FileUtils
7
-
8
- # path to your application root.
9
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
10
-
11
- def system!(*args)
12
- system(*args) || abort("\n== Command #{args} failed ==")
13
- end
14
-
15
- chdir APP_ROOT do
16
- # This script is a starting point to setup your application.
17
- # Add necessary setup steps to this file.
18
-
19
- puts '== Installing dependencies =='
20
- system! 'gem install bundler --conservative'
21
- system('bundle check') || system!('bundle install')
22
-
23
- # Install JavaScript dependencies if using Yarn
24
- # system('bin/yarn')
25
-
26
- # puts "\n== Copying sample files =="
27
- # unless File.exist?('config/database.yml')
28
- # cp 'config/database.yml.sample', 'config/database.yml'
29
- # end
30
-
31
- puts "\n== Preparing database =="
32
- system! 'bin/rails db:setup'
33
-
34
- puts "\n== Removing old logs and tempfiles =="
35
- system! 'bin/rails log:clear tmp:clear'
36
-
37
- puts "\n== Restarting application server =="
38
- system! 'bin/rails restart'
39
- end
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'pathname'
5
- require 'fileutils'
6
- include FileUtils
7
-
8
- # path to your application root.
9
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
10
-
11
- def system!(*args)
12
- system(*args) || abort("\n== Command #{args} failed ==")
13
- end
14
-
15
- chdir APP_ROOT do
16
- # This script is a way to update your development environment automatically.
17
- # Add necessary update steps to this file.
18
-
19
- puts '== Installing dependencies =='
20
- system! 'gem install bundler --conservative'
21
- system('bundle check') || system!('bundle install')
22
-
23
- puts "\n== Updating database =="
24
- system! 'bin/rails db:migrate'
25
-
26
- puts "\n== Removing old logs and tempfiles =="
27
- system! 'bin/rails log:clear tmp:clear'
28
-
29
- puts "\n== Restarting application server =="
30
- system! 'bin/rails restart'
31
- end
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- VENDOR_PATH = File.expand_path('..', __dir__)
5
- Dir.chdir(VENDOR_PATH) do
6
- begin
7
- exec "yarnpkg #{ARGV.join(' ')}"
8
- rescue Errno::ENOENT
9
- warn 'Yarn executable was not detected in the system.'
10
- warn 'Download Yarn at https://yarnpkg.com/en/docs/install'
11
- exit 1
12
- end
13
- end
@@ -1,10 +0,0 @@
1
- development:
2
- adapter: async
3
-
4
- test:
5
- adapter: async
6
-
7
- production:
8
- adapter: redis
9
- url: redis://localhost:6379/1
10
- channel_prefix: dummy_production
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- #
7
- default: &default
8
- adapter: sqlite3
9
- pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
- timeout: 5000
11
-
12
- development:
13
- <<: *default
14
- database: db/development.sqlite3
15
-
16
- # Warning: The database defined as "test" will be erased and
17
- # re-generated from your development database when you run "rake".
18
- # Do not set this db to the same as development or production.
19
- test:
20
- <<: *default
21
- database: db/test.sqlite3
22
-
23
- production:
24
- <<: *default
25
- database: db/production.sqlite3
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Rails.application.configure do
4
- # Settings specified here will take precedence over those in config/application.rb.
5
-
6
- # In the development environment your application's code is reloaded on
7
- # every request. This slows down response time but is perfect for development
8
- # since you don't have to restart the web server when you make code changes.
9
- config.cache_classes = false
10
-
11
- # Do not eager load code on boot.
12
- config.eager_load = false
13
-
14
- # Show full error reports.
15
- config.consider_all_requests_local = true
16
-
17
- # Enable/disable caching. By default caching is disabled.
18
- if Rails.root.join('tmp/caching-dev.txt').exist?
19
- config.action_controller.perform_caching = true
20
-
21
- config.cache_store = :memory_store
22
- config.public_file_server.headers = {
23
- 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
24
- }
25
- else
26
- config.action_controller.perform_caching = false
27
-
28
- config.cache_store = :null_store
29
- end
30
-
31
- # Don't care if the mailer can't send.
32
- config.action_mailer.raise_delivery_errors = false
33
-
34
- config.action_mailer.perform_caching = false
35
-
36
- # Print deprecation notices to the Rails logger.
37
- config.active_support.deprecation = :log
38
-
39
- # Raise an error on page load if there are pending migrations.
40
- config.active_record.migration_error = :page_load
41
-
42
- # Raises error for missing translations
43
- # config.action_view.raise_on_missing_translations = true
44
-
45
- # Use an evented file watcher to asynchronously detect changes in source code,
46
- # routes, locales, etc. This feature depends on the listen gem.
47
- # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
48
-
49
- RequireReloader.watch :bemer, path: Rails.root.join('..', '..').to_s,
50
- callback: proc { load Rails.root.join('config', 'initializers', 'bemer.rb') } # rubocop:disable Metrics/LineLength
51
- end