base-project 0.1.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 (39) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +37 -0
  3. data/.travis.yml +5 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +196 -0
  7. data/README.md +43 -0
  8. data/Rakefile +6 -0
  9. data/base-project.gemspec +38 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/lib/base/project.rb +7 -0
  13. data/lib/base/project/app/controllers/concerns/base_crud_controller.rb +104 -0
  14. data/lib/base/project/app/helpers/base_helper.rb +128 -0
  15. data/lib/base/project/app/helpers/button_helper.rb +101 -0
  16. data/lib/base/project/app/helpers/localizable_helper.rb +51 -0
  17. data/lib/base/project/app/helpers/panel_helper.rb +8 -0
  18. data/lib/base/project/app/models/concerns/addressable.rb +93 -0
  19. data/lib/base/project/app/models/concerns/base_user_concern.rb +39 -0
  20. data/lib/base/project/app/models/concerns/image_concern.rb +16 -0
  21. data/lib/base/project/app/models/concerns/localizable.rb +50 -0
  22. data/lib/base/project/app/models/concerns/scope_concern.rb +14 -0
  23. data/lib/base/project/app/validators/image_validator.rb +14 -0
  24. data/lib/base/project/app/views/_flash_messages.html.erb +12 -0
  25. data/lib/base/project/app/views/_menu.html.erb +16 -0
  26. data/lib/base/project/app/views/forms/_buttons.html.erb +4 -0
  27. data/lib/base/project/app/views/indexes/_buttons.html.erb +11 -0
  28. data/lib/base/project/app/views/indexes/_header.html.erb +10 -0
  29. data/lib/base/project/app/views/menu/_header_menu.html.erb +25 -0
  30. data/lib/base/project/app/views/menu/_sidebar.html.erb +44 -0
  31. data/lib/base/project/app/views/panels/_panel.html.erb +15 -0
  32. data/lib/base/project/app/views/versions/_model_dates.html.erb +12 -0
  33. data/lib/base/project/config/locales/error_pages.pt-BR.yml +9 -0
  34. data/lib/base/project/config/locales/pt-BR.yml +269 -0
  35. data/lib/base/project/config/locales/simple_form.pt-BR.yml +76 -0
  36. data/lib/base/project/lib/console_say.rb +17 -0
  37. data/lib/base/project/lib/string_sanitizer.rb +54 -0
  38. data/lib/base/project/version.rb +5 -0
  39. metadata +277 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1e4530b2d0b2257006b4f2d608c510aa295b14cd
4
+ data.tar.gz: b66ad81f696359f2bc30ee118872623669230de3
5
+ SHA512:
6
+ metadata.gz: 65c2c8f187566222cea5ca978508f2bb3fe8c638a5d90468eda331fdc366814d21a70290c8258e79fc56bbf9df0e31eef27997de9b210d4f18dbe83264bf4eef
7
+ data.tar.gz: a90ae3d2a3e70c434dd0fed4c7eff0d098a75c7b20fdb1970bce9d4b3db8440c85e9e7a39f507a1fee96e79b40295ed9454f616ccb706c55a60ed486691a3a93
@@ -0,0 +1,37 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ !/log/.keep
17
+ /tmp
18
+
19
+ *.rbc
20
+ capybara-*.html
21
+ .rspec
22
+ /public/assets
23
+ /public/system
24
+ /coverage/
25
+ /spec/tmp
26
+ *.orig
27
+ rerun.txt
28
+ pickle-email-*.html
29
+
30
+ .env
31
+
32
+ ## Environment normalization:
33
+ /.bundle
34
+ /vendor/bundle
35
+
36
+ # these should all be checked in to normalize the environment:
37
+ # Gemfile.lock, .ruby-version, .ruby-gemset
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.0
5
+ before_install: gem install bundler -v 1.16.0.pre.3
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at zehpavora@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in base-project.gemspec
6
+ gemspec
@@ -0,0 +1,196 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ base-project (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actioncable (5.1.4)
10
+ actionpack (= 5.1.4)
11
+ nio4r (~> 2.0)
12
+ websocket-driver (~> 0.6.1)
13
+ actionmailer (5.1.4)
14
+ actionpack (= 5.1.4)
15
+ actionview (= 5.1.4)
16
+ activejob (= 5.1.4)
17
+ mail (~> 2.5, >= 2.5.4)
18
+ rails-dom-testing (~> 2.0)
19
+ actionpack (5.1.4)
20
+ actionview (= 5.1.4)
21
+ activesupport (= 5.1.4)
22
+ rack (~> 2.0)
23
+ rack-test (>= 0.6.3)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
+ actionview (5.1.4)
27
+ activesupport (= 5.1.4)
28
+ builder (~> 3.1)
29
+ erubi (~> 1.4)
30
+ rails-dom-testing (~> 2.0)
31
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
+ activejob (5.1.4)
33
+ activesupport (= 5.1.4)
34
+ globalid (>= 0.3.6)
35
+ activemodel (5.1.4)
36
+ activesupport (= 5.1.4)
37
+ activerecord (5.1.4)
38
+ activemodel (= 5.1.4)
39
+ activesupport (= 5.1.4)
40
+ arel (~> 8.0)
41
+ activesupport (5.1.4)
42
+ concurrent-ruby (~> 1.0, >= 1.0.2)
43
+ i18n (~> 0.7)
44
+ minitest (~> 5.1)
45
+ tzinfo (~> 1.1)
46
+ arel (8.0.0)
47
+ attribute_normalizer (1.2.0)
48
+ bcrypt (3.1.11)
49
+ builder (3.2.3)
50
+ climate_control (0.2.0)
51
+ cocaine (0.5.8)
52
+ climate_control (>= 0.0.3, < 1.0)
53
+ concurrent-ruby (1.0.5)
54
+ countries (2.1.2)
55
+ i18n_data (~> 0.8.0)
56
+ money (~> 6.9)
57
+ sixarm_ruby_unaccent (~> 1.1)
58
+ unicode_utils (~> 1.4)
59
+ cpf_cnpj (0.4.1)
60
+ crass (1.0.3)
61
+ devise (4.3.0)
62
+ bcrypt (~> 3.0)
63
+ orm_adapter (~> 0.1)
64
+ railties (>= 4.1.0, < 5.2)
65
+ responders
66
+ warden (~> 1.2.3)
67
+ diff-lcs (1.3)
68
+ erubi (1.7.0)
69
+ globalid (0.4.1)
70
+ activesupport (>= 4.2.0)
71
+ i18n (0.9.1)
72
+ concurrent-ruby (~> 1.0)
73
+ i18n_data (0.8.0)
74
+ i18n_generators (2.1.1)
75
+ rails (>= 3.0.0)
76
+ loofah (2.1.1)
77
+ crass (~> 1.0.2)
78
+ nokogiri (>= 1.5.9)
79
+ mail (2.7.0)
80
+ mini_mime (>= 0.1.1)
81
+ method_source (0.9.0)
82
+ mime-types (3.1)
83
+ mime-types-data (~> 3.2015)
84
+ mime-types-data (3.2016.0521)
85
+ mimemagic (0.3.2)
86
+ mini_mime (1.0.0)
87
+ mini_portile2 (2.3.0)
88
+ minitest (5.10.3)
89
+ monetize (1.4.0)
90
+ money (~> 6.7)
91
+ money (6.10.0)
92
+ i18n (>= 0.6.4, < 1.0)
93
+ money-rails (1.7.0)
94
+ activesupport (>= 3.0)
95
+ monetize (~> 1.4.0)
96
+ money (~> 6.7)
97
+ railties (>= 3.0)
98
+ nested_form (0.3.2)
99
+ nio4r (2.1.0)
100
+ nokogiri (1.8.1)
101
+ mini_portile2 (~> 2.3.0)
102
+ orm_adapter (0.5.0)
103
+ paperclip (5.1.0)
104
+ activemodel (>= 4.2.0)
105
+ activesupport (>= 4.2.0)
106
+ cocaine (~> 0.5.5)
107
+ mime-types
108
+ mimemagic (~> 0.3.0)
109
+ rack (2.0.3)
110
+ rack-test (0.8.2)
111
+ rack (>= 1.0, < 3)
112
+ rails (5.1.4)
113
+ actioncable (= 5.1.4)
114
+ actionmailer (= 5.1.4)
115
+ actionpack (= 5.1.4)
116
+ actionview (= 5.1.4)
117
+ activejob (= 5.1.4)
118
+ activemodel (= 5.1.4)
119
+ activerecord (= 5.1.4)
120
+ activesupport (= 5.1.4)
121
+ bundler (>= 1.3.0)
122
+ railties (= 5.1.4)
123
+ sprockets-rails (>= 2.0.0)
124
+ rails-dom-testing (2.0.3)
125
+ activesupport (>= 4.2.0)
126
+ nokogiri (>= 1.6)
127
+ rails-html-sanitizer (1.0.3)
128
+ loofah (~> 2.0)
129
+ railties (5.1.4)
130
+ actionpack (= 5.1.4)
131
+ activesupport (= 5.1.4)
132
+ method_source
133
+ rake (>= 0.8.7)
134
+ thor (>= 0.18.1, < 2.0)
135
+ rake (10.5.0)
136
+ responders (2.4.0)
137
+ actionpack (>= 4.2.0, < 5.3)
138
+ railties (>= 4.2.0, < 5.3)
139
+ rspec (3.7.0)
140
+ rspec-core (~> 3.7.0)
141
+ rspec-expectations (~> 3.7.0)
142
+ rspec-mocks (~> 3.7.0)
143
+ rspec-core (3.7.0)
144
+ rspec-support (~> 3.7.0)
145
+ rspec-expectations (3.7.0)
146
+ diff-lcs (>= 1.2.0, < 2.0)
147
+ rspec-support (~> 3.7.0)
148
+ rspec-mocks (3.7.0)
149
+ diff-lcs (>= 1.2.0, < 2.0)
150
+ rspec-support (~> 3.7.0)
151
+ rspec-support (3.7.0)
152
+ simple_form (3.5.0)
153
+ actionpack (> 4, < 5.2)
154
+ activemodel (> 4, < 5.2)
155
+ sixarm_ruby_unaccent (1.2.0)
156
+ sprockets (3.7.1)
157
+ concurrent-ruby (~> 1.0)
158
+ rack (> 1, < 3)
159
+ sprockets-rails (3.2.1)
160
+ actionpack (>= 4.0)
161
+ activesupport (>= 4.0)
162
+ sprockets (>= 3.0.0)
163
+ thor (0.20.0)
164
+ thread_safe (0.3.6)
165
+ tzinfo (1.2.4)
166
+ thread_safe (~> 0.1)
167
+ unicode_utils (1.4.0)
168
+ validators (2.6.0)
169
+ warden (1.2.7)
170
+ rack (>= 1.0)
171
+ websocket-driver (0.6.5)
172
+ websocket-extensions (>= 0.1.0)
173
+ websocket-extensions (0.1.3)
174
+
175
+ PLATFORMS
176
+ ruby
177
+
178
+ DEPENDENCIES
179
+ attribute_normalizer
180
+ base-project!
181
+ bundler (~> 1.16.a)
182
+ countries
183
+ cpf_cnpj
184
+ devise
185
+ i18n_generators
186
+ money
187
+ money-rails
188
+ nested_form
189
+ paperclip
190
+ rake (~> 10.0)
191
+ rspec (~> 3.0)
192
+ simple_form
193
+ validators
194
+
195
+ BUNDLED WITH
196
+ 1.16.0.pre.3
@@ -0,0 +1,43 @@
1
+ # Base::Project
2
+
3
+ This project contains some base code for a Ruby on Rails project. There are base definitions for Addresses as well as ways to select them; There are definitions for a base CRUD controller;
4
+
5
+ And many more.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'base-project'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ ```
18
+ $ bundle
19
+ ```
20
+
21
+ Or install it yourself as:
22
+
23
+ ```
24
+ $ gem install base-project
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ We'll get to that later, sorry.
30
+
31
+ ## Development
32
+
33
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
34
+
35
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/[USERNAME]/base-project>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the Base::Project project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/base-project/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,38 @@
1
+
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'base/project/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'base-project'
8
+ spec.version = Base::Project::VERSION
9
+ spec.authors = ['José Ricardo Carvalho Prado de Almeida']
10
+ spec.email = ['zehpavora@gmail.com']
11
+
12
+ spec.summary = 'Base definitions for a project. Contains lots of usable reusables'
13
+ spec.homepage = 'https://github.com/zehpavora/base-project'
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
16
+ f.match(%r{^(test|spec|features)/})
17
+ end
18
+
19
+ spec.bindir = 'exe'
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ['lib']
22
+ spec.required_ruby_version = '>= 2.3.0'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.16.a'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.0'
27
+ spec.add_development_dependency 'devise'
28
+ spec.add_development_dependency 'cpf_cnpj'
29
+ spec.add_development_dependency 'validators'
30
+ spec.add_development_dependency 'attribute_normalizer'
31
+ spec.add_development_dependency 'money'
32
+ spec.add_development_dependency 'money-rails'
33
+ spec.add_development_dependency 'nested_form'
34
+ spec.add_development_dependency 'simple_form'
35
+ spec.add_development_dependency 'i18n_generators'
36
+ spec.add_development_dependency 'paperclip'
37
+ spec.add_development_dependency 'countries'
38
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "base/project"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here