bemer 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{LICENSE-RU → LICENSE-RU.txt} +0 -0
- data/{LICENSE → LICENSE.txt} +5 -5
- data/README.md +47 -16
- data/docs/BEMHTML.md +5 -0
- 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
- 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
- data/docs//320/237/321/200/320/265/320/264/320/270/320/272/320/260/321/202/321/213.md +205 -0
- data/docs//320/240/320/265/320/266/320/270/320/274/321/213.md +274 -0
- 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
- 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
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-bem_mix.md +62 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-bem_mods.md +63 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-block_tag.md +215 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-component_asset_path.md +71 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-component_pack.md +101 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-component_partial_path.md +28 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-define_component.md +154 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-define_templates.md +96 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-elem_tag.md +38 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-refine_component.md +114 -0
- data/docs//320/245/320/265/320/273/320/277/320/265/321/200-render_component.md +108 -0
- data/docs//320/250/320/260/320/261/320/273/320/276/320/275/321/213.md +44 -0
- data/lib/bemer.rb +3 -1
- data/lib/bemer/builders.rb +8 -0
- data/lib/bemer/builders/tree.rb +0 -8
- data/lib/bemer/configuration.rb +3 -1
- data/lib/bemer/context_extentions/structure.rb +2 -3
- data/lib/bemer/entity.rb +2 -2
- data/lib/bemer/entity_builder.rb +5 -9
- data/lib/bemer/helpers.rb +10 -0
- data/lib/bemer/mixin_list.rb +1 -1
- data/lib/bemer/modifier_list.rb +2 -2
- data/lib/bemer/path_resolver.rb +23 -0
- data/lib/bemer/pipeline/handler.rb +4 -6
- data/lib/bemer/railtie.rb +22 -9
- data/lib/bemer/renderer.rb +1 -1
- data/lib/bemer/template_list.rb +2 -4
- data/lib/bemer/tree.rb +3 -3
- data/lib/bemer/tree/node.rb +5 -7
- data/lib/bemer/version.rb +1 -1
- data/spec/bemer/railtie_spec.rb +95 -0
- data/spec/dummy/config/application.rb +30 -12
- data/spec/dummy/config/initializers/backtrace_silencers.rb +1 -5
- data/spec/dummy/config/initializers/bemer.rb +1 -3
- data/spec/rails_helper.rb +5 -9
- metadata +87 -129
- data/.gitignore +0 -17
- data/.overcommit.yml +0 -59
- data/.rspec +0 -4
- data/.rubocop.yml +0 -21
- data/.rubocop_todo.yml +0 -11
- data/Gemfile +0 -12
- data/Rakefile +0 -12
- data/bemer.gemspec +0 -43
- data/spec/dummy/Rakefile +0 -8
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +0 -4
- data/spec/dummy/app/jobs/application_job.rb +0 -4
- data/spec/dummy/app/mailers/application_mailer.rb +0 -6
- data/spec/dummy/app/models/application_record.rb +0 -5
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/spec/dummy/bin/bundle +0 -5
- data/spec/dummy/bin/rails +0 -6
- data/spec/dummy/bin/rake +0 -6
- data/spec/dummy/bin/setup +0 -39
- data/spec/dummy/bin/update +0 -31
- data/spec/dummy/bin/yarn +0 -13
- data/spec/dummy/config/cable.yml +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environments/development.rb +0 -51
- data/spec/dummy/config/environments/production.rb +0 -84
- data/spec/dummy/config/environments/test.rb +0 -44
- data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -7
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -6
- data/spec/dummy/config/initializers/inflections.rb +0 -17
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -16
- data/spec/dummy/config/locales/en.yml +0 -33
- data/spec/dummy/config/puma.rb +0 -58
- data/spec/dummy/config/routes.rb +0 -5
- data/spec/dummy/config/secrets.yml +0 -32
- data/spec/dummy/config/spring.rb +0 -8
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/package.json +0 -5
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
data/.gitignore
DELETED
data/.overcommit.yml
DELETED
@@ -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
data/.rubocop.yml
DELETED
@@ -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
|
data/.rubocop_todo.yml
DELETED
@@ -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
data/bemer.gemspec
DELETED
@@ -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
|
data/spec/dummy/Rakefile
DELETED
@@ -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
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= yield %>
|
data/spec/dummy/bin/bundle
DELETED
data/spec/dummy/bin/rails
DELETED
data/spec/dummy/bin/rake
DELETED
data/spec/dummy/bin/setup
DELETED
@@ -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
|
data/spec/dummy/bin/update
DELETED
@@ -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
|
data/spec/dummy/bin/yarn
DELETED
@@ -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
|
data/spec/dummy/config/cable.yml
DELETED
@@ -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
|