rspec-usecases 0.0.12

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: dbf5167aac3c896a46c81986794c7505fe50cad8efb7fa5b6986a962c0ca1d51
4
+ data.tar.gz: d93be1d47ac05674e9eab8f7d77514064ab727d47548a9ee251591f819e44d3f
5
+ SHA512:
6
+ metadata.gz: f7e09d32dbcd1c397d51e10f30a0f1d767682298b4d7379857b4b50698e3f205f005b74e7c21a586d28cc279953681633e17ac626832d3722462d0dee434a722
7
+ data.tar.gz: 66bd3d2d1af7e388b819285bdc7b32831ba59a8adfd43b4162ac4269317abb67f7b06580fee95f2b27632df5becb29ddd56bc9362af1c182af7889b5681d9fdb
@@ -0,0 +1,31 @@
1
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
2
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
3
+ name: Ruby
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ master ]
10
+
11
+ jobs:
12
+ test:
13
+
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Set up Ruby
19
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
20
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: 2.7.1
24
+ - name: Install dependencies
25
+ run: |
26
+ gem install bundler -v 2.2.5
27
+ bundle install
28
+ - name: Run tests
29
+ run: bundle exec rspec
30
+ - name: Run rubocop
31
+ run: bundle exec rubocop
@@ -0,0 +1,47 @@
1
+ # Move this into a KLUE SATELITE DOCUMENT
2
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
3
+ #
4
+ # If you find yourself ignoring temporary files generated by your text editor
5
+ # or operating system, you probably want to add a global ignore instead:
6
+ # git config --global core.excludesfile '~/.gitignore_global'
7
+ #
8
+ # The Octocat has a Gist containing some good rules to add to this file.
9
+ # https://gist.github.com/octocat/9257657
10
+
11
+ # Ignore Klue Setup.sh
12
+ /bin/runonce/
13
+ rspec_usecases.yml
14
+
15
+ /_/
16
+ /.bundle/
17
+ /.history/
18
+ /.yardoc
19
+ /_yardoc/
20
+ /coverage/
21
+ /log/
22
+ !/log/.keep
23
+ /doc/
24
+ /pkg/
25
+ /spec/reports/
26
+ /tmp/
27
+ !/tmp/.keep
28
+ *.bundle
29
+ *.so
30
+ *.o
31
+ *.a
32
+ mkmf.log
33
+
34
+ # Ruby Version
35
+ .ruby-version
36
+
37
+ # Environment File
38
+ .env
39
+
40
+ # Gems should not use a Gemfile.lock
41
+ Gemfile.lock
42
+
43
+ # rspec failure tracking
44
+ .rspec_status
45
+
46
+ # ByeBug history
47
+ .byebug_history
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,80 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require: rubocop-rake
4
+ AllCops:
5
+ TargetRubyVersion: 2.5
6
+ DisplayCopNames: true
7
+ ExtraDetails: true
8
+ NewCops: enable
9
+ Exclude:
10
+ - "_/**/*"
11
+
12
+ Metrics/BlockLength:
13
+ Exclude:
14
+ - "**/spec/**/*"
15
+ - "*.gemspec"
16
+ IgnoredMethods:
17
+ - configure
18
+ - context
19
+ - define
20
+ - describe
21
+ - draw
22
+ - factory
23
+ - feature
24
+ - guard
25
+ - included
26
+ - it
27
+ - let
28
+ - let!
29
+ - scenario
30
+ - setup
31
+ - shared_context
32
+ - shared_examples
33
+ - shared_examples_for
34
+ - transaction
35
+
36
+ Metrics/MethodLength:
37
+ Max: 25
38
+
39
+ Layout/LineLength:
40
+ Max: 200
41
+ # Ignores annotate output
42
+ IgnoredPatterns: ['\A# \*\*']
43
+ IgnoreCopDirectives: true
44
+
45
+ Lint/UnusedMethodArgument:
46
+ AllowUnusedKeywordArguments: true
47
+
48
+ Style/BlockComments:
49
+ Enabled: false
50
+ Include:
51
+ - "**/spec/*"
52
+
53
+ # My Preferences - Start
54
+ Metrics/ClassLength:
55
+ Enabled: false
56
+ Naming/MemoizedInstanceVariableName:
57
+ Enabled: false
58
+ Naming/VariableNumber:
59
+ Exclude:
60
+ - "**/spec/**/*"
61
+ Style/EmptyMethod:
62
+ Exclude:
63
+ - "**/spec/**/*"
64
+ Metrics/ParameterLists:
65
+ Exclude:
66
+ - "**/spec/**/*"
67
+ Layout/EmptyLineBetweenDefs:
68
+ Exclude:
69
+ - "**/spec/**/*"
70
+
71
+ Lint/AmbiguousBlockAssociation:
72
+ Exclude:
73
+ - "**/spec/**/*"
74
+
75
+ Style/AccessorGrouping:
76
+ Enabled: false
77
+
78
+ Layout/SpaceBeforeComma:
79
+ Enabled: false
80
+ # My Preferences - End
@@ -0,0 +1,7 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-01-24 00:05:00 UTC using RuboCop version 1.8.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.
@@ -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 david.cruwys@bugcrowd.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,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in rspec_usecases.gemspec
6
+ gemspec
7
+
8
+ group :development do
9
+ if ENV['RUBY_DEBUG_DEVELOPMENT']
10
+ # Currently conflicts with GitHub actions and so only available when
11
+ # environment varialbe is set.
12
+ # On Mac:
13
+ # ```export RUBY_DEBUG_DEVELOPMENT=true```
14
+ gem 'jazz_fingers'
15
+ gem 'pry-coolline', github: 'owst/pry-coolline', branch: 'support_new_pry_config_api'
16
+ end
17
+ end
18
+
19
+ group :development, :test do
20
+ gem 'guard-bundler'
21
+ gem 'guard-rspec'
22
+ gem 'guard-rubocop'
23
+ gem 'rake', '~> 12.0'
24
+ gem 'rake-compiler', require: false
25
+ gem 'rspec', '~> 3.0'
26
+ gem 'rubocop'
27
+ gem 'rubocop-rake', require: false
28
+ gem 'rubocop-rspec', require: false
29
+ end
30
+
31
+ # Temporary path:
32
+ # group :test do
33
+ # gem 'k_usecases', path: '~/dev/kgems/k_usecases'
34
+ # end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ guard :bundler, cmd: 'bundle install' do
4
+ watch('Gemfile')
5
+ watch('rspec_usecases.gemspec')
6
+ end
7
+
8
+ group :green_pass_then_cop, halt_on_fail: true do
9
+ guard :rspec, cmd: 'bundle exec rspec -f doc' do
10
+ require 'guard/rspec/dsl'
11
+ dsl = Guard::RSpec::Dsl.new(self)
12
+
13
+ # RSpec files
14
+ rspec = dsl.rspec
15
+ watch(rspec.spec_helper) { rspec.spec_dir }
16
+ watch(rspec.spec_support) { rspec.spec_dir }
17
+ watch(rspec.spec_files)
18
+
19
+ # Ruby files
20
+ ruby = dsl.ruby
21
+ dsl.watch_spec_files_for(ruby.lib_files)
22
+ watch(%r{^lib/rspec/usecases/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
23
+ watch(%r{^lib/rspec/usecases/commands/(.+)\.rb$}) { |m| "spec/unit/commands/#{m[1]}_spec.rb" }
24
+ end
25
+
26
+ guard :rubocop, all_on_start: false, cli: ['--format', 'clang'] do
27
+ watch(/{.+\.rb$/)
28
+ watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
29
+ end
30
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 David Cruwys
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.
@@ -0,0 +1,69 @@
1
+ # Rspec Usecases
2
+
3
+ > Rspec Usecases helps to write self-documenting code usage examples that execute as normal unit tests while outputting documentation in varied formats
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'rspec-usecases'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```bash
16
+ bundle install
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```bash
22
+ gem install rspec-usecases
23
+ ```
24
+
25
+ ## Stories
26
+
27
+ ### Main Story
28
+
29
+ As a Ruby Developer, I want to document code usage examples, so that people can get going quickly with implementation
30
+
31
+ See all [stories](./STORIES.md)
32
+
33
+ ## Usage
34
+
35
+ See all [usage examples](./USAGE.md)
36
+
37
+ ### Basic Example
38
+
39
+ #### Basic example
40
+
41
+ Description for a basic example to be featured in the main README.MD file
42
+
43
+ ```ruby
44
+ class SomeRuby; end
45
+ ```
46
+
47
+ ## Development
48
+
49
+ 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.
50
+
51
+ `rspec-usecases` is setup with Guard, run `guard`, this will watch development file changes and run tests automatically, if successful, it will then run rubocop for style quality.
52
+
53
+ 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).
54
+
55
+ ## Contributing
56
+
57
+ Bug reports and pull requests are welcome on GitHub at https://github.com/klueless-io/rspec-usecases. 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.
58
+
59
+ ## License
60
+
61
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
62
+
63
+ ## Code of Conduct
64
+
65
+ Everyone interacting in the Rspec Usecases project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/klueless-io/rspec-usecases/blob/master/CODE_OF_CONDUCT.md).
66
+
67
+ ## Copyright
68
+
69
+ Copyright (c) David Cruwys. See [MIT License](LICENSE.txt) for further details.
@@ -0,0 +1,17 @@
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
+ require 'rake/extensiontask'
9
+
10
+ desc 'Compile all the extensions'
11
+ task build: :compile
12
+
13
+ Rake::ExtensionTask.new('rspec_usecases') do |ext|
14
+ ext.lib_dir = 'lib/rspec_usecases'
15
+ end
16
+
17
+ task default: %i[clobber compile spec]
@@ -0,0 +1,56 @@
1
+ # Rspec Usecases
2
+
3
+ > Rspec Usecases helps to write self-documenting code usage examples that execute as normal unit tests while outputting documentation in varied formats
4
+
5
+ As a Ruby Developer, I want to document code usage examples, so that people can get going quickly with implementation
6
+
7
+ ## Development radar
8
+
9
+ ### Stories next on list
10
+
11
+ As a Developer, I can generate documentation in various formats, so that I easily document ruby applications
12
+
13
+ - Build Documentor with flexible renderer plugins
14
+
15
+ As a Developer, I can build documentable usecases, so that I easily document usage examples
16
+
17
+ - Build Usecase
18
+
19
+ ### Tasks next on list
20
+
21
+ Setup RubyGems and RubyDoc
22
+
23
+ - Build and deploy gem to [rubygems.org](https://rubygems.org/gems/rspec-usecases)
24
+ - Attach documentation to [rubydoc.info](https://rubydoc.info/github/to-do-/rspec-usecases/master)
25
+
26
+ Setup GitHub Action (test and lint)
27
+
28
+ - Setup Rspec action
29
+ - Setup RuboCop action
30
+
31
+ ## Stories and tasks
32
+
33
+ ### Stories - completed
34
+
35
+ As a Developer, I can extract code and other content from unit test, so that I can inject it into documentation
36
+
37
+ - Build Content, ContentCode an ContentOutcome
38
+
39
+ ### Tasks - completed
40
+
41
+ Setup project management, requirement and SCRUM documents
42
+
43
+ - Setup readme file
44
+ - Setup user stories and tasks
45
+ - Setup a project backlog
46
+ - Setup an examples/usage document
47
+
48
+ Setup new Ruby GEM
49
+
50
+ - Build out a standard GEM structure
51
+ - Add automated semantic versioning
52
+ - Add Rspec unit testing framework
53
+ - Add RuboCop linting
54
+ - Add Guard for automatic watch and test
55
+ - Add GitFlow support
56
+ - Add GitHub Repository