GeneSaudeId 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +3 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +10 -0
  6. data/GeneSaudeId.gemspec +30 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +37 -0
  9. data/Rakefile +8 -0
  10. data/bin/GeneSaudeId +146 -0
  11. data/bin/console +15 -0
  12. data/bin/genesaudeid +146 -0
  13. data/bin/setup +8 -0
  14. data/lib/GeneSaudeId/GeneSaudeId_helper.rb +42 -0
  15. data/lib/GeneSaudeId/version.rb +5 -0
  16. data/lib/GeneSaudeId.rb +7 -0
  17. data/lib/SkeletonApi/.gitignore +1 -0
  18. data/lib/SkeletonApi/.rubocop.yml +62 -0
  19. data/lib/SkeletonApi/.solargraph.yml +16 -0
  20. data/lib/SkeletonApi/Gemfile +18 -0
  21. data/lib/SkeletonApi/README.md +36 -0
  22. data/lib/SkeletonApi/cucumber.yml +11 -0
  23. data/lib/SkeletonApi/features/specs/.gitkeep +0 -0
  24. data/lib/SkeletonApi/features/steps_definitions/.gitkeep +0 -0
  25. data/lib/SkeletonApi/features/support/config/environments/dev.yml +5 -0
  26. data/lib/SkeletonApi/features/support/config/environments/qa.yml +5 -0
  27. data/lib/SkeletonApi/features/support/data/factories/.gitkeep +0 -0
  28. data/lib/SkeletonApi/features/support/data/models/.gitkeep +0 -0
  29. data/lib/SkeletonApi/features/support/data/schemas/.gitkeep +0 -0
  30. data/lib/SkeletonApi/features/support/env.rb +30 -0
  31. data/lib/SkeletonApi/features/support/helper.rb +6 -0
  32. data/lib/SkeletonApi/features/support/hooks.rb +53 -0
  33. data/lib/SkeletonApi/features/support/services/.gitkeep +0 -0
  34. data/lib/SkeletonApi/report/.gitkeep +0 -0
  35. data/lib/SkeletonApi/report/junit/.gitkeep +0 -0
  36. data/lib/SkeletonWeb/.gitignore +8 -0
  37. data/lib/SkeletonWeb/.rubocop.yml +53 -0
  38. data/lib/SkeletonWeb/.solargraph.yml +16 -0
  39. data/lib/SkeletonWeb/Gemfile +13 -0
  40. data/lib/SkeletonWeb/README.md +49 -0
  41. data/lib/SkeletonWeb/cucumber.yml +17 -0
  42. data/lib/SkeletonWeb/features/specs/.gitkeep +0 -0
  43. data/lib/SkeletonWeb/features/steps_definitions/.gitkeep +0 -0
  44. data/lib/SkeletonWeb/features/support/config/elements.yml +2 -0
  45. data/lib/SkeletonWeb/features/support/config/environments/dev.yml +1 -0
  46. data/lib/SkeletonWeb/features/support/config/environments/qa.yml +1 -0
  47. data/lib/SkeletonWeb/features/support/env.rb +46 -0
  48. data/lib/SkeletonWeb/features/support/helper.rb +37 -0
  49. data/lib/SkeletonWeb/features/support/hooks.rb +56 -0
  50. data/lib/SkeletonWeb/features/support/pages/.gitkeep +0 -0
  51. data/lib/SkeletonWeb/report/.gitkeep +0 -0
  52. data/lib/SkeletonWeb/report/junit/.gitkeep +0 -0
  53. data/lib/SkeletonWeb/report/screenshots/test_failed/.gitkeep +0 -0
  54. data/lib/SkeletonWeb/report/screenshots/test_passed/.gitkeep +0 -0
  55. data/lib/locales/en.yml +17 -0
  56. data/lib/locales/pt.yml +16 -0
  57. data/lib/templates/feature.tt +8 -0
  58. data/lib/templates/page.tt +4 -0
  59. data/lib/templates/services.tt +8 -0
  60. data/lib/templates/steps.tt +5 -0
  61. data/sig/GeneSaudeId.rbs +4 -0
  62. metadata +191 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4010fc175ed7f131bc4e414a9edab8a0b0689d4b819e2c522a93b34fae7b051f
4
+ data.tar.gz: 55f7bdc14ed031b3393c5cc7d0afeadae34c5deb4f9511f8f238a2b9369aa5e2
5
+ SHA512:
6
+ metadata.gz: 5cbf3ac97fe8c79b06d3816642888a044837474ebde5929a3f167ee0d3f46ffa4e05381d41325653331e85296887db7554281eb531149af6a9a39d44f8e6a4c5
7
+ data.tar.gz: b2b84a4db9a096eae6de36b62964380dae2b7b70f38ee982a4ef66a65a89bad99872ec633c11a9736ba43e9ac0ab073e8657324020c94879b080a9c3a9aad1f8
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ *.gem
13
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at raphael_antonio_vieira@hotmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in GeneSaudeId.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/GeneSaudeId/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "GeneSaudeId"
7
+ spec.version = GeneSaudeId::VERSION
8
+ spec.authors = ["Raphael Castro"]
9
+ spec.email = ["raphael_antonio_vieira@hotmail.com"]
10
+ spec.summary = %q{Generates an Web, Api and Mobile Test Automation project with Cucumber, Rspec,
11
+ Capybara, Selenium, Httparty and JsonSchema.}
12
+ spec.description = %q{A simple gem to generate all files needed in a
13
+ project Mobile, Web and Api for Testing Automation.}
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+
21
+ spec.executables = ['genesaudeid']
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency 'bundler', '~> 2.3.20'
25
+ spec.add_runtime_dependency 'i18n', '~> 0.8'
26
+ spec.add_development_dependency 'rake', '~> 10.0'
27
+ spec.add_development_dependency 'rspec', '~> 3.0'
28
+ spec.add_development_dependency 'simplecov', '~> 0.16.1'
29
+ spec.add_runtime_dependency 'thor', '~> 0.20.0'
30
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Raphael Castro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # GeneSaudeId
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/GeneSaudeId`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add GeneSaudeId
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install GeneSaudeId
16
+
17
+ ## Usage
18
+
19
+ TODO: Write usage instructions here
20
+
21
+ ## Development
22
+
23
+ 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.
24
+
25
+ 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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/GeneSaudeId. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/GeneSaudeId/blob/master/CODE_OF_CONDUCT.md).
30
+
31
+ ## License
32
+
33
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
34
+
35
+ ## Code of Conduct
36
+
37
+ Everyone interacting in the GeneSaudeId project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/GeneSaudeId/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/bin/GeneSaudeId ADDED
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'i18n'
4
+ require 'json'
5
+ require 'tempfile'
6
+ require 'thor'
7
+ require 'thor/group'
8
+ require 'yaml'
9
+
10
+ require File.join(File.dirname(__FILE__),
11
+ '../lib/GeneSaudeId/GeneSaudeId_helper')
12
+ require_relative '../lib/GeneSaudeId/version.rb'
13
+
14
+ module GeneCapybara
15
+ class Generate < Thor
16
+ include Thor::Actions
17
+
18
+ desc 'feature [RESOURCE_NAME]', 'Generates a feature'
19
+ option :lang,
20
+ banner: 'any of the gherkin support languages',
21
+ default: :en
22
+ def feature(name)
23
+ I18n.config.default_locale = option[:lang]
24
+ in_root_project_folder?
25
+ create_feature_file(name)
26
+ end
27
+
28
+ desc 'step [RESOURCE_NAME]', 'Generates a step'
29
+ option :lang,
30
+ banner: 'any of the gherkin supported languages',
31
+ default: :en
32
+ def step(name)
33
+ I18n.config.default_locale = options[:lang]
34
+ in_root_project_folder?
35
+ create_steps_file name
36
+ end
37
+
38
+ desc 'page [RESOURCE_NAME]', 'Generates pages'
39
+ option :lang,
40
+ banner: 'any of the gherkin supported languages',
41
+ default: :en
42
+ def page(name)
43
+ I18n.config.default_locale = options[:lang]
44
+ in_root_project_folder?
45
+ create_page_file name
46
+ end
47
+
48
+ desc 'services [RESOURCE_NAME]', 'Generates services'
49
+ option :lang,
50
+ banner: 'any of the gherkin supported languages',
51
+ default: :en
52
+ def service(name)
53
+ I18n.config.default_locale = options[:lang]
54
+ in_root_project_folder?
55
+ create_service_file name
56
+ end
57
+
58
+ desc 'all_web [RESOURCE_NAME]', 'Generates features, steps and pages'
59
+ option :lang,
60
+ banner: 'any of the gherkin supported languages',
61
+ default: :en
62
+ def all_web(name)
63
+ I18n.config.default_locale = options[:lang]
64
+ in_root_project_folder?
65
+ create_feature_file name
66
+ create_steps_file name
67
+ create_page_file name
68
+ end
69
+
70
+ desc 'all_api [RESOURCE_NAME]', 'Generates feature and steps'
71
+ option :lang,
72
+ banner: 'any of the gherkin supported languages',
73
+ default: :en
74
+ def all_api(name)
75
+ I18n.config.default_locale = options[:lang]
76
+ in_root_project_folder?
77
+ create_feature_file name
78
+ create_steps_file name
79
+ create_service_file name
80
+ end
81
+
82
+ def self.source_root
83
+ File.join(File.dirname(__FILE__), '../lib/templates')
84
+ end
85
+ end
86
+ end
87
+
88
+ module GeneCapybara
89
+ class GeneCapybaraRunner < Thor
90
+ include Thor::Actions
91
+
92
+ map %w[-v --version] => :version
93
+
94
+ default_task :help
95
+
96
+ register GeneCapybara::Generate, 'generate',
97
+ 'generate [GENERATOR] [RESOURCE_NAME]',
98
+ 'Generates various resources'
99
+ register GeneCapybara::Generate, 'g',
100
+ 'g [GENERATOR] [RESOURCE_NAME]',
101
+ 'Generates various resources'
102
+
103
+ desc 'new web PROJECT_NAME',
104
+ 'Generates the structure of a new project that uses '\
105
+ 'Capybara, Selenium and Cucumber'
106
+ option :lang,
107
+ banner: 'any of the gherkin supported languages',
108
+ default: :en
109
+ def new_web(name)
110
+ I18n.config.default_locale = options[:lang]
111
+ directory File.join(File.dirname(__FILE__),
112
+ '../lib/SkeletonWeb'), name
113
+ end
114
+
115
+ desc 'new api PROJECT_NAME',
116
+ 'Generates the structure of api'
117
+ option :lang,
118
+ banner: 'any of the gherkin supported languages',
119
+ default: :en
120
+ def new_api(name)
121
+ I18n.config.default_locale = options[:lang]
122
+ directory File.join(File.dirname(__FILE__),
123
+ '../lib/SkeletonApi'), name
124
+ end
125
+
126
+ desc 'version', 'Shows the gem version'
127
+ def version
128
+ puts "GeneCapybara Version #{GeneSaudeId::VERSION}"
129
+ end
130
+
131
+ def self.source_root
132
+ File.join(File.dirname(__FILE__), '../lib/templates')
133
+ end
134
+
135
+ def initialize(*args)
136
+ super
137
+ locales_folder_path = File.join(File.dirname(__FILE__),
138
+ '../lib/locales')
139
+ I18n.load_path = Dir[File.join(locales_folder_path, '*.yml')]
140
+ I18n.backend.load_translations
141
+ I18n.config.enforce_available_locales = true
142
+ end
143
+ end
144
+ end
145
+
146
+ GeneCapybara::GeneCapybaraRunner.start
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "GeneSaudeId"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/genesaudeid ADDED
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'i18n'
4
+ require 'json'
5
+ require 'tempfile'
6
+ require 'thor'
7
+ require 'thor/group'
8
+ require 'yaml'
9
+
10
+ require File.join(File.dirname(__FILE__),
11
+ '../lib/GeneSaudeId/GeneSaudeId_helper')
12
+ require_relative '../lib/GeneSaudeId/version.rb'
13
+
14
+ module GeneCapybara
15
+ class Generate < Thor
16
+ include Thor::Actions
17
+
18
+ desc 'feature [RESOURCE_NAME]', 'Generates a feature'
19
+ option :lang,
20
+ banner: 'any of the gherkin support languages',
21
+ default: :en
22
+ def feature(name)
23
+ I18n.config.default_locale = option[:lang]
24
+ in_root_project_folder?
25
+ create_feature_file(name)
26
+ end
27
+
28
+ desc 'step [RESOURCE_NAME]', 'Generates a step'
29
+ option :lang,
30
+ banner: 'any of the gherkin supported languages',
31
+ default: :en
32
+ def step(name)
33
+ I18n.config.default_locale = options[:lang]
34
+ in_root_project_folder?
35
+ create_steps_file name
36
+ end
37
+
38
+ desc 'page [RESOURCE_NAME]', 'Generates pages'
39
+ option :lang,
40
+ banner: 'any of the gherkin supported languages',
41
+ default: :en
42
+ def page(name)
43
+ I18n.config.default_locale = options[:lang]
44
+ in_root_project_folder?
45
+ create_page_file name
46
+ end
47
+
48
+ desc 'services [RESOURCE_NAME]', 'Generates services'
49
+ option :lang,
50
+ banner: 'any of the gherkin supported languages',
51
+ default: :en
52
+ def service(name)
53
+ I18n.config.default_locale = options[:lang]
54
+ in_root_project_folder?
55
+ create_service_file name
56
+ end
57
+
58
+ desc 'all_web [RESOURCE_NAME]', 'Generates features, steps and pages'
59
+ option :lang,
60
+ banner: 'any of the gherkin supported languages',
61
+ default: :en
62
+ def all_web(name)
63
+ I18n.config.default_locale = options[:lang]
64
+ in_root_project_folder?
65
+ create_feature_file name
66
+ create_steps_file name
67
+ create_page_file name
68
+ end
69
+
70
+ desc 'all_api [RESOURCE_NAME]', 'Generates feature and steps'
71
+ option :lang,
72
+ banner: 'any of the gherkin supported languages',
73
+ default: :en
74
+ def all_api(name)
75
+ I18n.config.default_locale = options[:lang]
76
+ in_root_project_folder?
77
+ create_feature_file name
78
+ create_steps_file name
79
+ create_service_file name
80
+ end
81
+
82
+ def self.source_root
83
+ File.join(File.dirname(__FILE__), '../lib/templates')
84
+ end
85
+ end
86
+ end
87
+
88
+ module GeneCapybara
89
+ class GeneCapybaraRunner < Thor
90
+ include Thor::Actions
91
+
92
+ map %w[-v --version] => :version
93
+
94
+ default_task :help
95
+
96
+ register GeneCapybara::Generate, 'generate',
97
+ 'generate [GENERATOR] [RESOURCE_NAME]',
98
+ 'Generates various resources'
99
+ register GeneCapybara::Generate, 'g',
100
+ 'g [GENERATOR] [RESOURCE_NAME]',
101
+ 'Generates various resources'
102
+
103
+ desc 'new web PROJECT_NAME',
104
+ 'Generates the structure of a new project that uses '\
105
+ 'Capybara, Selenium and Cucumber'
106
+ option :lang,
107
+ banner: 'any of the gherkin supported languages',
108
+ default: :en
109
+ def new_web(name)
110
+ I18n.config.default_locale = options[:lang]
111
+ directory File.join(File.dirname(__FILE__),
112
+ '../lib/SkeletonWeb'), name
113
+ end
114
+
115
+ desc 'new api PROJECT_NAME',
116
+ 'Generates the structure of api'
117
+ option :lang,
118
+ banner: 'any of the gherkin supported languages',
119
+ default: :en
120
+ def new_api(name)
121
+ I18n.config.default_locale = options[:lang]
122
+ directory File.join(File.dirname(__FILE__),
123
+ '../lib/SkeletonApi'), name
124
+ end
125
+
126
+ desc 'version', 'Shows the gem version'
127
+ def version
128
+ puts "GeneCapybara Version #{GeneSaudeId::VERSION}"
129
+ end
130
+
131
+ def self.source_root
132
+ File.join(File.dirname(__FILE__), '../lib/templates')
133
+ end
134
+
135
+ def initialize(*args)
136
+ super
137
+ locales_folder_path = File.join(File.dirname(__FILE__),
138
+ '../lib/locales')
139
+ I18n.load_path = Dir[File.join(locales_folder_path, '*.yml')]
140
+ I18n.backend.load_translations
141
+ I18n.config.enforce_available_locales = true
142
+ end
143
+ end
144
+ end
145
+
146
+ GeneCapybara::GeneCapybaraRunner.start
data/bin/setup ADDED
@@ -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
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ def create_feature_file(name)
4
+ opts = { name: camelize(name) }
5
+ template('feature', File.join(FileUtils.pwd, 'features', 'specs',
6
+ "#{name.downcase}.feature"), opts)
7
+ end
8
+
9
+ def create_steps_file(name)
10
+ opts = { name: camelize(name) }
11
+ template('steps', File.join(FileUtils.pwd, 'features', 'steps_definitions',
12
+ "#{name.downcase}_steps.rb"), opts)
13
+ end
14
+
15
+ def create_page_file(name)
16
+ opts = { name: camelize(name) }
17
+ binding.pry
18
+ template('page', File.join(FileUtils.pwd, 'features/support', 'pages',
19
+ "#{name.downcase}_page.rb"), opts)
20
+ end
21
+
22
+ def create_service_file(name)
23
+ opts = { name: camelize(name) }
24
+ template('services', File.join(FileUtils.pwd, 'features/support', 'services',
25
+ "#{name.downcase}_services.rb"), opts)
26
+ end
27
+
28
+ def camelize(string)
29
+ camelized = ''
30
+ string.split('_').each do |s|
31
+ camelized += s.capitalize
32
+ end
33
+ camelized
34
+ end
35
+
36
+ def in_root_project_folder?
37
+ unless Dir.exist?(File.join(FileUtils.pwd, 'features', 'specs'))
38
+ puts 'Please run this command on the root folder of the project'
39
+ exist 1
40
+ end
41
+ true
42
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GeneSaudeId
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "GeneSaudeId/version"
4
+
5
+ module GeneSaudeId
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1 @@
1
+ .DS_Store
@@ -0,0 +1,62 @@
1
+ AllCops:
2
+ NewCops: disable
3
+
4
+ SuggestExtensions: false
5
+
6
+ #Verifica o comprimento máximo de colunas numa linha, máximo padrão (120) | manter 160
7
+ Layout/LineLength:
8
+ Exclude:
9
+ - 'features/support/factories/*.rb'
10
+ Max: 160
11
+
12
+ #Verifica se excede o tamanho máximo da assinatura dos métodos, máximo padrão (17) | manter desabilitado
13
+ Metrics/AbcSize:
14
+ Enabled: false
15
+
16
+ #Verifica se excede o tamanho máximo do bloco de código, máximo padrão (25) | manter máximo 100
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - 'features/support/factories/*.rb'
20
+ Max: 100
21
+
22
+ #Verifica se excede o número de linhas de uma classe, máximo padrão (100) | manter desabilitado
23
+ Metrics/ClassLength:
24
+ Enabled: false
25
+
26
+ #Verifica se excede o numero da complexidade ciclomatica (numero de caminhos linearmente independentes através de um método) | máximo padrão (7) - manter o padrão
27
+ Metrics/CyclomaticComplexity:
28
+ Max: 7
29
+
30
+ #Verifica se excede o tamanho máximo do bloco dentro do método, máximo padrão (10) | manter 20
31
+ Metrics/MethodLength:
32
+ Exclude:
33
+ - 'features/support/models/*.rb'
34
+ - 'features/support/services/*.rb'
35
+ Max: 20
36
+ #Verifica se excede o tamanho máximo de um modulo, máximo padrão (100) | manter desabilitado
37
+
38
+ Metrics/ModuleLength:
39
+ Enabled: false
40
+
41
+ #Verifica a existência de caracteres não-ascii em nomes de identificadores e constantes, valor default = Enabled: true | manter desabilitado
42
+ Naming/AsciiIdentifiers:
43
+ Enabled: false
44
+
45
+ #Verifica se os nomes usam os estilo configurado, valor default = snake_case | manter desabilitado
46
+ Naming/MethodName:
47
+ Enabled: false
48
+
49
+ #Verifica a falta de documentação de nível superior de classes e módulos | manter desabilitada
50
+ Style/Documentation:
51
+ Enabled: false
52
+
53
+ #Manter desabilitada
54
+ Style/FrozenStringLiteralComment:
55
+ Enabled: false
56
+
57
+ #Manter desabilitada
58
+ Style/SingleArgumentDig:
59
+ Enabled: false
60
+
61
+ Style/RedundantAssignment:
62
+ Enabled: false