etude_for_ruby 0.0.0 → 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.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.idea/.rakeTasks +1 -1
- data/.idea/jenkinsSettings.xml +7 -0
- data/.yardopts +4 -1
- data/Dockerfile-dev +3 -1
- data/Gemfile.lock +39 -0
- data/README.md +2 -0
- data/circle.yml +11 -1
- data/docs/README.md +4 -1
- data/docs/_config.yml +3 -0
- data/docs/dev/fizz_buzz.md +11 -0
- data/docs/ops/ship_ruby_gem.md +3 -3
- data/etude_for_ruby.iml +11 -2
- data/lib/etude_for_ruby/version.rb +1 -1
- data/lib/etude_for_ruby.rb +1 -0
- data/lib/fizz_buzz/buzz.rb +5 -0
- data/lib/fizz_buzz/fizz.rb +5 -0
- data/lib/fizz_buzz/fizz_buzz.rb +5 -0
- data/lib/fizz_buzz/fizz_buzz_factory.rb +32 -0
- data/lib/fizz_buzz/not_fizz_buzz.rb +5 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d7091bd233b11947daddf55fff55323c0527116
|
4
|
+
data.tar.gz: fde89610f60ca52af2eb66df2fb65748b0e537fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4976734d52305e6b7eb1fe9ad825f8096b0ae2782a3a2052d80847ed4fc4352a097f199fa7ad0c7edd23fa8a88445070191e1cb9869c22fcc6f44d8bbcf2f5c
|
7
|
+
data.tar.gz: 734e940d3df802b163c3429dd00d9a53d014d0f825b1e5da23a9597ec31c12d45ef9987872483849ac599e55e1e4a4c519e196b804c37c4e575ecd563e861dae
|
data/.gitignore
CHANGED
data/.idea/.rakeTasks
CHANGED
@@ -4,4 +4,4 @@ You are allowed to:
|
|
4
4
|
1. Remove rake task
|
5
5
|
2. Add existing rake tasks
|
6
6
|
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
-
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build etude_for_ruby-0.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build etude_for_ruby-0.0.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install etude_for_ruby-0.0.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install etude_for_ruby-0.0.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.0.0 and build and push etude_for_ruby-0.0.0.gem to Rubygems" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="Generate YARD Documentation" fullCmd="yard" taksId="yard" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
data/.yardopts
CHANGED
data/Dockerfile-dev
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
FROM app:base
|
2
2
|
|
3
|
-
ENV APP_ROOT /
|
3
|
+
ENV APP_ROOT /container
|
4
|
+
ADD . $APP_ROOT
|
4
5
|
WORKDIR $APP_ROOT
|
5
6
|
COPY Gemfile $APP_ROOT
|
6
7
|
COPY Gemfile.lock $APP_ROOT
|
@@ -9,6 +10,7 @@ COPY etude_for_ruby.gemspec $APP_ROOT
|
|
9
10
|
COPY . $APP_ROOT
|
10
11
|
RUN bundle
|
11
12
|
RUN bundle exec rspec
|
13
|
+
RUn bundle exec rake build
|
12
14
|
|
13
15
|
EXPOSE 5000
|
14
16
|
CMD ["bin/console"]
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
etude_for_ruby (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.3)
|
10
|
+
rake (10.5.0)
|
11
|
+
redcarpet (3.4.0)
|
12
|
+
rspec (3.5.0)
|
13
|
+
rspec-core (~> 3.5.0)
|
14
|
+
rspec-expectations (~> 3.5.0)
|
15
|
+
rspec-mocks (~> 3.5.0)
|
16
|
+
rspec-core (3.5.4)
|
17
|
+
rspec-support (~> 3.5.0)
|
18
|
+
rspec-expectations (3.5.0)
|
19
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
20
|
+
rspec-support (~> 3.5.0)
|
21
|
+
rspec-mocks (3.5.0)
|
22
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
23
|
+
rspec-support (~> 3.5.0)
|
24
|
+
rspec-support (3.5.0)
|
25
|
+
yard (0.9.8)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
bundler (~> 1.14)
|
32
|
+
etude_for_ruby!
|
33
|
+
rake (~> 10.0)
|
34
|
+
redcarpet (~> 3.4)
|
35
|
+
rspec (~> 3.0)
|
36
|
+
yard (~> 0.8)
|
37
|
+
|
38
|
+
BUNDLED WITH
|
39
|
+
1.14.6
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# EtudeForRuby
|
2
2
|
|
3
3
|
[](https://circleci.com/gh/k2works/etude_for_ruby)
|
4
|
+
[](https://github.com/k2works/etude_for_ruby/blob/develop/LICENSE.txt)
|
5
|
+
[](https://badge.fury.io/rb/etude_for_ruby)
|
4
6
|
|
5
7
|
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/etude_for_ruby`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
8
|
|
data/circle.yml
CHANGED
@@ -7,4 +7,14 @@ test:
|
|
7
7
|
pre:
|
8
8
|
- bundle
|
9
9
|
override:
|
10
|
-
- bundle exec rspec
|
10
|
+
- bundle exec rspec
|
11
|
+
|
12
|
+
deployment:
|
13
|
+
rubygems:
|
14
|
+
branch: master
|
15
|
+
commands:
|
16
|
+
- curl -u $RUBYGEMS_USER:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
|
17
|
+
- git config user.name $RUBYGEMS_USER
|
18
|
+
- git config user.email $RUBYGEMS_EMAIL
|
19
|
+
- bundle exec rake build
|
20
|
+
- bundle exec rake release
|
data/docs/README.md
CHANGED
@@ -32,6 +32,8 @@ Rubyプログラミング練習
|
|
32
32
|
**[⬆ back to top](#構成)**
|
33
33
|
|
34
34
|
## 開発
|
35
|
+
### [FizzBuzz](./dev/fizz_buzz.md)
|
36
|
+
|
35
37
|
**[⬆ back to top](#構成)**
|
36
38
|
|
37
39
|
## 運用
|
@@ -39,4 +41,5 @@ Rubyプログラミング練習
|
|
39
41
|
|
40
42
|
**[⬆ back to top](#運用)**
|
41
43
|
|
42
|
-
# 参照 #
|
44
|
+
# 参照 #
|
45
|
+
+ [Project: RSpec Expectations 3.5](https://www.relishapp.com/rspec/rspec-expectations/v/3-5/docs/built-in-matchers)
|
data/docs/_config.yml
ADDED
data/docs/ops/ship_ruby_gem.md
CHANGED
@@ -13,14 +13,14 @@ bundle exec rake build
|
|
13
13
|
```bash
|
14
14
|
gem build etude_for_ruby.gemspec
|
15
15
|
```
|
16
|
-
|
17
16
|
### Gemの公開
|
18
17
|
```bash
|
19
|
-
gem push etude_for_ruby.
|
18
|
+
gem push etude_for_ruby-0.0.0.gem
|
20
19
|
```
|
21
20
|
|
22
21
|
## 注意
|
23
22
|
+ 公開するバージョンは都度更新する
|
24
23
|
|
25
24
|
## 参照
|
26
|
-
+ [Version Badge](https://badge.fury.io/)
|
25
|
+
+ [Version Badge](https://badge.fury.io/)
|
26
|
+
+ [RubygemsへのデプロイをCircleCIで自動化してみた](http://leko.jp/archives/871)
|
data/etude_for_ruby.iml
CHANGED
@@ -56,8 +56,17 @@
|
|
56
56
|
</component>
|
57
57
|
<component name="NewModuleRootManager">
|
58
58
|
<content url="file://$MODULE_DIR$" />
|
59
|
-
<orderEntry type="jdk" jdkName="
|
59
|
+
<orderEntry type="jdk" jdkName="rbenv: 2.4.0" jdkType="RUBY_SDK" />
|
60
60
|
<orderEntry type="sourceFolder" forTests="false" />
|
61
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.14.6,
|
61
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.14.6, rbenv: 2.4.0) [gem]" level="application" />
|
62
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, rbenv: 2.4.0) [gem]" level="application" />
|
63
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v10.5.0, rbenv: 2.4.0) [gem]" level="application" />
|
64
|
+
<orderEntry type="library" scope="PROVIDED" name="redcarpet (v3.4.0, rbenv: 2.4.0) [gem]" level="application" />
|
65
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.5.0, rbenv: 2.4.0) [gem]" level="application" />
|
66
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.5.4, rbenv: 2.4.0) [gem]" level="application" />
|
67
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.5.0, rbenv: 2.4.0) [gem]" level="application" />
|
68
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.5.0, rbenv: 2.4.0) [gem]" level="application" />
|
69
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.5.0, rbenv: 2.4.0) [gem]" level="application" />
|
70
|
+
<orderEntry type="library" scope="PROVIDED" name="yard (v0.9.8, rbenv: 2.4.0) [gem]" level="application" />
|
62
71
|
</component>
|
63
72
|
</module>
|
data/lib/etude_for_ruby.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'fizz'
|
2
|
+
require_relative 'buzz'
|
3
|
+
require_relative 'fizz_buzz'
|
4
|
+
require_relative 'not_fizz_buzz'
|
5
|
+
|
6
|
+
class FizzBuzzFactory
|
7
|
+
def self.create(number)
|
8
|
+
@number = number
|
9
|
+
if self.fizz?
|
10
|
+
Fizz.new
|
11
|
+
elsif self.buzz?
|
12
|
+
Buzz.new
|
13
|
+
elsif self.fizz_buzz?
|
14
|
+
FizzBuzz.new
|
15
|
+
else
|
16
|
+
NotFizzBuzz.new
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
def self.fizz?
|
22
|
+
@number % 3 == 0 && @number % 5 != 0
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.buzz?
|
26
|
+
@number % 3 != 0 && @number % 5 == 0
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.fizz_buzz?
|
30
|
+
@number % 3 == 0 && @number % 5 == 0
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etude_for_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k2works
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- ".gitignore"
|
91
91
|
- ".idea/.rakeTasks"
|
92
92
|
- ".idea/inspectionProfiles/Project_Default.xml"
|
93
|
+
- ".idea/jenkinsSettings.xml"
|
93
94
|
- ".idea/misc.xml"
|
94
95
|
- ".idea/modules.xml"
|
95
96
|
- ".idea/vcs.xml"
|
@@ -100,6 +101,7 @@ files:
|
|
100
101
|
- Dockerfile
|
101
102
|
- Dockerfile-dev
|
102
103
|
- Gemfile
|
104
|
+
- Gemfile.lock
|
103
105
|
- Jenkinsfile
|
104
106
|
- LICENSE.txt
|
105
107
|
- README.md
|
@@ -110,6 +112,8 @@ files:
|
|
110
112
|
- circle.yml
|
111
113
|
- docker-compose.yml
|
112
114
|
- docs/README.md
|
115
|
+
- docs/_config.yml
|
116
|
+
- docs/dev/fizz_buzz.md
|
113
117
|
- docs/dev/images/.keep
|
114
118
|
- docs/ops/build_docker.md
|
115
119
|
- docs/ops/build_vagrant.md
|
@@ -125,6 +129,11 @@ files:
|
|
125
129
|
- etude_for_ruby.iml
|
126
130
|
- lib/etude_for_ruby.rb
|
127
131
|
- lib/etude_for_ruby/version.rb
|
132
|
+
- lib/fizz_buzz/buzz.rb
|
133
|
+
- lib/fizz_buzz/fizz.rb
|
134
|
+
- lib/fizz_buzz/fizz_buzz.rb
|
135
|
+
- lib/fizz_buzz/fizz_buzz_factory.rb
|
136
|
+
- lib/fizz_buzz/not_fizz_buzz.rb
|
128
137
|
homepage: https://github.com/k2works/etude_for_ruby
|
129
138
|
licenses:
|
130
139
|
- MIT
|