development-toolbox 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73194980d52600991c585260695b41b5b571a291
4
- data.tar.gz: 283c5500828a75862171e119ee27cccfff4586a1
3
+ metadata.gz: c10a9e633173c4c4aaaa8da134ffd1489db061ce
4
+ data.tar.gz: 4f84850071b231207ac8bacf02c9057918f07f9a
5
5
  SHA512:
6
- metadata.gz: a6646b35466611ab2e62c6af5d7126ff65a548d5c9d195a035191b03fa0eb565952a5327e244e793e03979ec3d2d75e0e3c5b7395e77810cc0201f1e394b461c
7
- data.tar.gz: 8d63b82b7db8691130c470919432b2e79c044886325375debd521dea2cf8133e10b4dc324547fb44210b0f7e34d92e380cc3d68c368b819463eec3d25fc1ca1c
6
+ metadata.gz: 3cf0ab05d0508c591c32091bb52cafdd1f3da370b4d7a2a8627cef591868eb5ecaf67733bb55da474df136849b986359b044c94ee2d9c61411036241f40f8b7a
7
+ data.tar.gz: c865f099320e033e21246068c8276e75448deeca3a376b2db8f10acb98479e16000ae405597b9d8a7908821803190e6c5590b271bf4810d38847deccbf1234a7
data/.gitlab-ci.yml CHANGED
@@ -1,19 +1,90 @@
1
- # This file is a template, and might need editing before it works on your project.
2
- # Official language image. Look for the different tagged releases at:
3
- image: ruby:latest
4
-
5
- # Cache gems in between builds
6
- cache:
7
- paths:
8
- - .bundle
9
-
10
- # This is a basic example for a gem or script which doesn't use
11
- # services such as redis or postgres
12
- before_script:
13
- - ruby -v # Print out ruby version for debugging
14
- - gem install bundler --no-ri --no-rdoc # Bundler is not installed with the image
15
- - bundle install -j $(nproc) --path=".bundle" # Install dependencies into ./.bundle
16
-
17
- rake:
1
+ # See documentation at https://docs.gitlab.com/ee/ci/yaml/README.html
2
+ variables:
3
+ CI_REGISTRY_IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
4
+ CI_REGISTRY_IMAGE_STABLE: $CI_REGISTRY_IMAGE:stable
5
+
6
+ stages:
7
+ - test
8
+ - deploy
9
+
10
+ .docker_build: &docker
11
+ image: docker:latest
12
+ services:
13
+ - docker:dind
14
+ before_script:
15
+ - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
16
+
17
+ .ruby_build: &ruby
18
+ image: $CI_REGISTRY_IMAGE_LATEST
19
+ # Cache gems in between builds
20
+ cache:
21
+ paths:
22
+ - /cache
23
+ # This is a basic example for a gem or script which doesn't use
24
+ # services such as redis or postgres
25
+ before_script:
26
+ - ruby -v # Print out ruby version for debugging
27
+ - gem install bundler --no-ri --no-rdoc # Bundler is not installed with the image
28
+ - bundle install -j $(nproc) --path=".bundle" # Install dependencies into ./.bundle
29
+
30
+ .release_docker_image: &release_docker_image
31
+ <<: *docker
32
+ stage: deploy
18
33
  script:
19
- - rake
34
+ - echo "Releasing ${$TARGET_IMAGE} from $CI_REGISTRY_IMAGE_LATEST"
35
+ - docker pull $CI_REGISTRY_IMAGE_LATEST
36
+ - docker tag $CI_REGISTRY_IMAGE_LATEST ${$TARGET_IMAGE}
37
+ - docker push ${$TARGET_IMAGE}
38
+
39
+ test:
40
+ <<: *ruby
41
+ script: bin/rake test
42
+ stage: test
43
+ artifacts:
44
+ paths:
45
+ - Gemfile.lock
46
+ - spec/reports
47
+ - coverage
48
+
49
+ doc:
50
+ <<: *ruby
51
+ script: bin/rake doc
52
+ stage: test
53
+ artifacts:
54
+ paths:
55
+ - doc
56
+
57
+ build latest docker:
58
+ <<: *docker
59
+ stage: deploy
60
+ only:
61
+ - develop
62
+ dependencies:
63
+ - test
64
+ script:
65
+ - echo "Building $CI_REGISTRY_IMAGE_LATEST"
66
+ - docker build --pull -t $CI_REGISTRY_IMAGE_LATEST .
67
+ - docker push $CI_REGISTRY_IMAGE_LATEST
68
+
69
+ build stable docker:
70
+ <<: *docker
71
+ stage: deploy
72
+ only:
73
+ - master
74
+ dependencies:
75
+ - test
76
+ script:
77
+ - echo "Building $CI_REGISTRY_IMAGE_STABLE"
78
+ - docker build --pull -t $CI_REGISTRY_IMAGE_STABLE .
79
+ - docker push $CI_REGISTRY_IMAGE_STABLE
80
+
81
+ build_gem:
82
+ <<: *ruby
83
+ script: bin/rake build
84
+ only:
85
+ - develop
86
+ stage: deploy
87
+ artifacts:
88
+ paths:
89
+ - doc
90
+ - pkg
data/.yardopts ADDED
@@ -0,0 +1,4 @@
1
+ --title='Development::Toolbox'
2
+ --load=lib/yard/templates/helpers/markup_helper/commonmarker.rb
3
+ --markup-provider=commonmarker
4
+ --markup=markdown
data/Dockerfile ADDED
@@ -0,0 +1,21 @@
1
+ FROM ruby:2.4-alpine
2
+
3
+ RUN apk --update --upgrade add --no-cache \
4
+ build-base \
5
+ cmake \
6
+ coreutils \
7
+ git
8
+
9
+ RUN mkdir /app
10
+ WORKDIR /app
11
+
12
+ RUN gem install bundler --no-ri --no-rdoc
13
+
14
+ ADD lib/development/toolbox/version.rb /app/lib/development/toolbox/version.rb
15
+ ADD development-toolbox.gemspec /app/development-toolbox.gemspec
16
+ ADD Gemfile /app/Gemfile
17
+ ADD Gemfile.lock /app/Gemfile.lock
18
+
19
+ RUN bundle install
20
+
21
+ ADD . /app
data/README.md CHANGED
@@ -11,7 +11,7 @@ Set of tools every Ruby developer needs to provide quality Ruby code.
11
11
  `spec.add_development_dependency 'development-toolbox'`
12
12
  * _developing an app:_
13
13
  1. Add this line to your application's Gemfile:
14
- `gem 'development-toolbox'`
14
+ `gem 'development-toolbox', group: %i[development test]`
15
15
  1. And then execute: `bundle` to install required dependencies.
16
16
  * _Or install it yourself if you have no code yet:_
17
17
  1. Execute `gem install development-toolbox`
@@ -24,9 +24,11 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ['lib']
25
25
 
26
26
  spec.add_runtime_dependency 'bundler', '~> 1.13'
27
+ spec.add_runtime_dependency 'bundler-audit', '~> 0.5'
28
+ spec.add_runtime_dependency 'commonmarker', '~> 0.14'
29
+ spec.add_runtime_dependency 'github-markup', '~> 1.6'
27
30
  spec.add_runtime_dependency 'rake', '~> 12.0'
28
31
  spec.add_runtime_dependency 'rspec', '~> 3.5'
29
32
  spec.add_runtime_dependency 'rubocop', '~> 0.48'
30
33
  spec.add_runtime_dependency 'yard', '~> 0.9'
31
- spec.add_runtime_dependency 'kramdown', '~> 1.13'
32
34
  end
@@ -0,0 +1,4 @@
1
+ version: '2'
2
+ services:
3
+ gem:
4
+ image: registry.gitlab.com/alsemyonov/development-toolbox:latest
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'commonmarker/compat_renderer'
4
+
5
+ Markdown = CommonMarker::CompatRenderer unless defined? Markdown
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'commonmarker'
4
+
5
+ module CommonMarker
6
+ # Compatibility with the RedCloth API.
7
+ # @see https://github.com/vmg/redcarpet/blob/master/lib/redcarpet/compat.rb#L1
8
+ class CompatRenderer
9
+ attr_accessor :text
10
+
11
+ GITHUB_EXTENSIONS = %i[tagfilter autolink table strikethrough].freeze
12
+
13
+ def initialize(text, exts = GITHUB_EXTENSIONS, options: :GITHUB_PRE_LANG)
14
+ @text = text
15
+ @extensions = GITHUB_EXTENSIONS | exts
16
+ @options = options
17
+ end
18
+
19
+ def to_html(*_dummy)
20
+ CommonMarker.render_html(text, options, extensions)
21
+ end
22
+
23
+ private
24
+
25
+ # @return [String]
26
+ attr_reader :text
27
+
28
+ # @return [Symbol]
29
+ attr_reader :options
30
+
31
+ # @return [<Symbol>]
32
+ attr_reader :extensions
33
+ end
34
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Development
4
4
  module Toolbox
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yard'
4
+ require 'yard/templates/helpers/markup_helper'
5
+ require 'commonmarker/compat_renderer'
6
+ require 'github-markup'
7
+ require 'github/markup'
8
+
9
+ # @see https://github.com/lsegal/yard/blob/master/lib/yard/templates/helpers/markup_helper.rb#L26
10
+ YARD::Templates::Helpers::MarkupHelper::MARKUP_PROVIDERS[:markdown] <<
11
+ { lib: :commonmarker, const: 'CommonMarker::CompatRenderer' }
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/audit/cli'
4
+
5
+ namespace :audit do
6
+ desc 'Updates the ruby-advisory-db'
7
+ task :update do
8
+ Bundler::Audit::CLI.start %w[update]
9
+ end
10
+
11
+ desc 'Check bundle for vulnerable dependencies'
12
+ task test: :update do
13
+ Bundler::Audit::CLI.start %w[check]
14
+ end
15
+ end
data/rakelib/test.rake CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  desc 'Test and check style'
4
- task test: %i[spec style]
4
+ task test: %i[spec audit:test style]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: development-toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Semyonov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-07 00:00:00.000000000 Z
11
+ date: 2017-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,6 +24,48 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler-audit
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: commonmarker
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.14'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.14'
55
+ - !ruby/object:Gem::Dependency
56
+ name: github-markup
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.6'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.6'
27
69
  - !ruby/object:Gem::Dependency
28
70
  name: rake
29
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +122,6 @@ dependencies:
80
122
  - - "~>"
81
123
  - !ruby/object:Gem::Version
82
124
  version: '0.9'
83
- - !ruby/object:Gem::Dependency
84
- name: kramdown
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.13'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.13'
97
125
  description: Efficient Developer tools
98
126
  email:
99
127
  - alex@semyonov.us
@@ -109,7 +137,9 @@ files:
109
137
  - ".rubocop.yml"
110
138
  - ".rubocop_todo.yml"
111
139
  - ".travis.yml"
140
+ - ".yardopts"
112
141
  - CODE_OF_CONDUCT.md
142
+ - Dockerfile
113
143
  - Gemfile
114
144
  - LICENSE
115
145
  - README.md
@@ -131,10 +161,15 @@ files:
131
161
  - bin/yardoc
132
162
  - bin/yri
133
163
  - development-toolbox.gemspec
164
+ - docker-compose.yml
134
165
  - exe/development-toolbox
166
+ - lib/commonmarker/compat.rb
167
+ - lib/commonmarker/compat_renderer.rb
135
168
  - lib/development/tasks.rb
136
169
  - lib/development/toolbox.rb
137
170
  - lib/development/toolbox/version.rb
171
+ - lib/yard/templates/helpers/markup_helper/commonmarker.rb
172
+ - rakelib/audit.rake
138
173
  - rakelib/default.rake
139
174
  - rakelib/doc.rake
140
175
  - rakelib/spec.rake
@@ -160,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
195
  version: '0'
161
196
  requirements: []
162
197
  rubyforge_project:
163
- rubygems_version: 2.6.10
198
+ rubygems_version: 2.6.11
164
199
  signing_key:
165
200
  specification_version: 4
166
201
  summary: Development toolbox for a Ruby programmer