qiita_trend 0.2.4 → 0.4.9

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
  SHA256:
3
- metadata.gz: 67f621ef51f4952e930e558fc7a001a39dd14544609df431308315cdfd803d9b
4
- data.tar.gz: 1a386d98d6c15d9dda039c3a560ae19c0f181a7085c1cfb60159849bb7ecde31
3
+ metadata.gz: 8a73fc251bb36d817331e9cc0e311dedfe4f269c750ceda90e55a28cb5888ffe
4
+ data.tar.gz: 5f2f5f8e6c7778f8712f4e21f103d3d8421fe69f4c32dc66ec5fe6043f0a11e6
5
5
  SHA512:
6
- metadata.gz: c7f38145d52040ca27b5f9e1d33c415198485dee42699b097ca79995eb8f53f293c7a2cb98ea4163120d61125465e1cf1bbf190efadba3d2c48c8bef76a895ac
7
- data.tar.gz: 968142b1d157328b68d3401fbfb785c4f830cb985f420944bb33a3628ca2787c9b8a49114e3032d4035928f353830a77718505240db45012dafbf4b6428196fb
6
+ metadata.gz: 9faaa422189653c626a611919b3de48735fae61b2747bf6d4e791c8c17b931940445204b5b0087d5c160c367cf31d869c2bf7be174695b0e702e6feecce7c966
7
+ data.tar.gz: 26cb95bea2a55c5eb49db2394f268ec55db0183225a5bdff25356a487639dea31d95ecad44de4c2ace1e2f968e2a9d3c8e6f17844bb5a438bd9ba2e7e3895fda
data/.circleci/config.yml CHANGED
@@ -1,82 +1,164 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
1
+ version: 2.1
2
+ orbs:
3
+ ruby: circleci/ruby@1.1.2
4
+ slack: circleci/slack@3.4.2
5
+ executors:
6
+ base:
8
7
  docker:
9
- # specify the version you desire here
10
- - image: circleci/ruby:2.6.0-node-browsers
8
+ - image: cimg/ruby:2.6.6
9
+ auth:
10
+ username: dodonki1223
11
+ password: $DOCKERHUB_PASSWORD
11
12
  environment:
12
- BUNDLER_VERSION: 2.0.1
13
+ # Bundlerのパス設定が書き換えられ`vendor/bundle`ではなくて`/usr/local/bundle`を参照してしまい`bundle exec`でエラーになる
14
+ # Bundlerのconfigファイル(pathの設定がされたもの)をworkspaceで永続化し`vendor/bundle`を参照するようにするための設定
15
+ BUNDLE_APP_CONFIG: .bundle
16
+ # ref: https://circleci.com/docs/2.0/faq/#how-can-i-set-the-timezone-in-docker-images
17
+ TZ: "Asia/Tokyo"
18
+ working_directory: ~/dodonki1223/qiita_trend
13
19
 
14
- # Specify service dependencies here if necessary
15
- # CircleCI maintains a library of pre-built images
16
- # documented at https://circleci.com/docs/2.0/circleci-images/
17
- # - image: circleci/postgres:9.4
20
+ commands:
21
+ save-workspace:
22
+ steps:
23
+ - persist_to_workspace:
24
+ # working_directory からの相対パスか絶対パスを指定します
25
+ root: .
26
+ paths: .
18
27
 
19
- working_directory: ~/repo
28
+ using-workspace:
29
+ steps:
30
+ - attach_workspace:
31
+ # working_directory からの相対パスか絶対パスを指定します
32
+ at: .
20
33
 
34
+ collect-reports:
35
+ steps:
36
+ - store_artifacts:
37
+ # カバレッジの結果をcoverage-resultsディレクトリに吐き出す
38
+ path: coverage
39
+ destination: coverage-results
40
+
41
+ create-document:
21
42
  steps:
22
- - checkout
23
- # Download and cache dependencies
24
- - restore_cache:
25
- keys:
26
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
27
- # fallback to using the latest cache if no exact match is found
28
- - v1-dependencies-
29
- # install Bundler!
30
- # ref:https://discuss.circleci.com/t/using-bundler-2-0-during-ci-fails/27411
31
- - run:
32
- name: install bundler
33
- command: |
34
- sudo gem update --system
35
- sudo gem uninstall bundler
36
- sudo rm /usr/local/bin/bundle
37
- sudo rm /usr/local/bin/bundler
38
- sudo gem install bundler
39
- # install gem!
40
43
  - run:
41
- name: install gem
44
+ name: Create document
42
45
  command: |
43
- # jobs=4は並列処理をして高速化するための設定(4つのjobで実行するって意味)
44
- bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
45
- - save_cache:
46
- paths:
47
- - ./vendor/bundle
48
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
49
- # run rubocop!
46
+ bundle exec yard
47
+ - store_artifacts:
48
+ # ドキュメントの結果をyard-resultsディレクトリに吐き出す
49
+ path: ./doc
50
+ destination: yard-results
51
+
52
+ deploy-rubygems:
53
+ steps:
54
+ # https://discuss.circleci.com/t/the-authenticity-of-github-host-cant-be-stablished/33133 と同じ現象で job が進まなくなるので以下の記事を参考に実装
55
+ # ref:https://circleci.com/docs/ja/2.0/gh-bb-integration/#ssh-%E3%83%9B%E3%82%B9%E3%83%88%E3%81%AE%E4%BF%A1%E9%A0%BC%E6%80%A7%E3%81%AE%E7%A2%BA%E7%AB%8B
50
56
  - run:
51
- name: run rubocop
57
+ name: Avoid hosts unknown for github
52
58
  command: |
53
- bundle exec rubocop
54
- # run tests!
59
+ mkdir -p ~/.ssh
60
+ echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
61
+ ' >> ~/.ssh/known_hosts
62
+
55
63
  - run:
56
- name: run tests
64
+ name: Deploy RubyGems
57
65
  command: |
58
- mkdir /tmp/test-results
59
- TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
60
- bundle exec rspec \
61
- --format progress \
62
- --format RspecJunitFormatter \
63
- --out /tmp/test-results/rspec.xml \
64
- --format progress \
65
- $TEST_FILES
66
- # collect reports
67
- - store_test_results:
68
- path: /tmp/test-results
69
- - store_artifacts:
70
- path: /tmp/test-results
71
- destination: test-results
72
- # deploy RubyGems
66
+ curl -u dodonki1223:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
67
+ chmod 0600 ~/.gem/credentials
68
+ git config user.name dodonki1223
69
+ git config user.email $RUBYGEMS_EMAIL
70
+ bundle exec rake build
71
+ bundle exec rake release
72
+
73
+ deploy-notification:
74
+ steps:
75
+ - slack/status:
76
+ success_message: ':circleci-pass: RubyGemsにデプロイが完了しました\n:github_octocat: User: $CIRCLE_USERNAME'
77
+ failure_message: ':circleci-fail: RubyGemsにデプロイが失敗しました\n:github_octocat: User: $CIRCLE_USERNAME'
78
+
79
+ jobs:
80
+ setup:
81
+ executor: base
82
+ steps:
83
+ - checkout
84
+ - ruby/install-deps
85
+ - save-workspace
86
+
87
+ lint:
88
+ executor: base
89
+ steps:
90
+ - using-workspace
91
+ - ruby/install-deps
92
+ - ruby/rubocop-check
93
+
94
+ test:
95
+ executor: base
96
+ steps:
97
+ - using-workspace
98
+ - ruby/install-deps
99
+ - ruby/rspec-test:
100
+ out-path: 'test_results/rspec/'
101
+ - collect-reports
102
+
103
+ document:
104
+ executor: base
105
+ steps:
106
+ - using-workspace
107
+ - ruby/install-deps
108
+ - create-document
109
+
110
+ deploy:
111
+ executor: base
112
+ steps:
113
+ - using-workspace
114
+ - ruby/install-deps
115
+ - deploy-rubygems
116
+ - deploy-notification
117
+
118
+ workflows:
119
+ version: 2.1
120
+ main:
121
+ jobs:
122
+ - setup
123
+ - lint:
124
+ requires:
125
+ - setup
126
+ - test:
127
+ requires:
128
+ - setup
129
+ - document:
130
+ requires:
131
+ - setup
132
+ - slack/approval-notification:
133
+ message: ':circleci-pass: RubyGemsへのデプロイ準備が整っています\n:github_octocat: User: $CIRCLE_USERNAME\nデプロイを実行する場合は *Approve* を押してください'
134
+ requires:
135
+ - lint
136
+ - test
137
+ filters:
138
+ branches:
139
+ only: master
140
+ - approval-job:
141
+ type: approval
142
+ requires:
143
+ - slack/approval-notification
73
144
  - deploy:
74
- command: |
75
- if [ "${CIRCLE_BRANCH}" == "master" ]; then
76
- mkdir ~/.gem
77
- curl -u dodonki1223:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
78
- git config user.name dodonki1223
79
- git config user.email $RUBYGEMS_EMAIL
80
- bundle exec rake build
81
- bundle exec rake release
82
- fi
145
+ requires:
146
+ - approval-job
147
+ filters:
148
+ branches:
149
+ only: master
150
+ # 定期でテストを実行する
151
+ # ref:https://circleci.com/docs/ja/2.0/triggers/
152
+ nightly:
153
+ triggers:
154
+ - schedule:
155
+ cron: "0 22 * * *" # UTCで記述
156
+ filters:
157
+ branches:
158
+ only:
159
+ - master
160
+ jobs:
161
+ - setup
162
+ - test:
163
+ requires:
164
+ - setup
data/.gitignore CHANGED
@@ -6,9 +6,15 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/
10
+ /test_results/
9
11
 
10
12
  # rspec failure tracking
11
13
  .rspec_status
12
14
 
15
+ # Exclude InteliJ
16
+ .idea
17
+
13
18
  /cache/
14
- /spec/vcr/
19
+ /spec/vcr/
20
+ /vendor/
data/.rubocop.yml CHANGED
@@ -3,34 +3,36 @@ require: rubocop-rspec
3
3
 
4
4
  AllCops:
5
5
  # Rubyのバージョン指定
6
- TargetRubyVersion: 2.3.7
6
+ TargetRubyVersion: 2.6.5
7
+ # 新しい cop を許可
8
+ NewCops: enable
7
9
 
8
10
  # クラス名Moduleの説明をなしでもOKとする
9
11
  Style/Documentation:
10
12
  Enabled: false
11
13
 
12
14
  # 日本語でのコメントを許可
13
- AsciiComments:
15
+ Style/AsciiComments:
14
16
  Enabled: false
15
17
 
16
18
  # メソッドの引数の文字数を2文字以上とする
17
- Naming/UncommunicativeMethodParamName:
19
+ Naming/MethodParameterName:
18
20
  MinNameLength: 2
19
21
 
20
22
  # 1行の長さのMAXを150文字とする
21
- Metrics/LineLength:
23
+ Layout/LineLength:
22
24
  Max: 150
23
25
 
24
26
  # メソッドの行数をコメントを除いて50行までとする
25
- MethodLength:
27
+ Metrics/MethodLength:
26
28
  CountComments: true
27
29
  Max: 50
28
30
 
29
31
  # if文の実行結果が4行以上の場合にチェックするように設定する
30
- GuardClause:
32
+ Style/GuardClause:
31
33
  MinBodyLength: 4
32
34
 
33
- IfUnlessModifier:
35
+ Style/IfUnlessModifier:
34
36
  Enabled: false
35
37
 
36
38
  # メソッドの複雑度を7→18に変更
@@ -66,3 +68,31 @@ Metrics/ModuleLength:
66
68
  # Rspec句のitの行数を5→10に変更
67
69
  RSpec/ExampleLength:
68
70
  Max: 10
71
+
72
+ # https://docs.rubocop.org/en/stable/cops_layout/#layoutspacearoundmethodcalloperator
73
+ Layout/SpaceAroundMethodCallOperator:
74
+ Enabled: true
75
+
76
+ # https://docs.rubocop.org/en/latest/cops_lint/#lintraiseexception
77
+ Lint/RaiseException:
78
+ Enabled: true
79
+
80
+ # https://docs.rubocop.org/en/latest/cops_lint/#lintstructnewoverride
81
+ Lint/StructNewOverride:
82
+ Enabled: true
83
+
84
+ # https://docs.rubocop.org/en/latest/cops_style/#styleexponentialnotation
85
+ Style/ExponentialNotation:
86
+ Enabled: true
87
+
88
+ # https://docs.rubocop.org/en/latest/cops_style/#stylehasheachmethods
89
+ Style/HashEachMethods:
90
+ Enabled: true
91
+
92
+ # https://docs.rubocop.org/en/latest/cops_style/#stylehashtransformkeys
93
+ Style/HashTransformKeys:
94
+ Enabled: true
95
+
96
+ # https://docs.rubocop.org/en/latest/cops_style/#stylehashtransformvalues
97
+ Style/HashTransformValues:
98
+ Enabled: true
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.6.5
data/Gemfile.lock CHANGED
@@ -1,101 +1,134 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qiita_trend (0.2.4)
5
- mechanize
6
- nokogiri (~> 1.9)
4
+ qiita_trend (0.4.9)
5
+ mechanize (~> 2.7)
6
+ nokogiri (~> 1.11)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.6.0)
12
- public_suffix (>= 2.0.2, < 4.0)
13
- ast (2.4.0)
14
- connection_pool (2.2.2)
15
- crack (0.4.3)
16
- safe_yaml (~> 1.0.0)
17
- diff-lcs (1.3)
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ ast (2.4.2)
14
+ byebug (11.1.3)
15
+ coderay (1.1.3)
16
+ connection_pool (2.2.3)
17
+ crack (0.4.5)
18
+ rexml
19
+ diff-lcs (1.4.4)
20
+ docile (1.3.5)
18
21
  domain_name (0.5.20190701)
19
22
  unf (>= 0.0.5, < 1.0.0)
20
- hashdiff (1.0.0)
23
+ hashdiff (1.0.1)
21
24
  http-cookie (1.0.3)
22
25
  domain_name (~> 0.5)
23
- jaro_winkler (1.5.3)
24
- mechanize (2.7.6)
25
- domain_name (~> 0.5, >= 0.5.1)
26
- http-cookie (~> 1.0)
27
- mime-types (>= 1.17.2)
28
- net-http-digest_auth (~> 1.1, >= 1.1.1)
29
- net-http-persistent (>= 2.5.2)
30
- nokogiri (~> 1.6)
31
- ntlm-http (~> 0.1, >= 0.1.1)
32
- webrobots (>= 0.0.9, < 0.2)
33
- mime-types (3.2.2)
26
+ mechanize (2.8.0)
27
+ addressable (~> 2.7)
28
+ domain_name (~> 0.5, >= 0.5.20190701)
29
+ http-cookie (~> 1.0, >= 1.0.3)
30
+ mime-types (~> 3.0)
31
+ net-http-digest_auth (~> 1.4, >= 1.4.1)
32
+ net-http-persistent (>= 2.5.2, < 5.0.dev)
33
+ nokogiri (~> 1.11, >= 1.11.2)
34
+ rubyntlm (~> 0.6, >= 0.6.3)
35
+ webrick (~> 1.7)
36
+ webrobots (~> 0.1.2)
37
+ method_source (1.0.0)
38
+ mime-types (3.3.1)
34
39
  mime-types-data (~> 3.2015)
35
- mime-types-data (3.2019.0331)
36
- mini_portile2 (2.4.0)
40
+ mime-types-data (3.2021.0225)
37
41
  net-http-digest_auth (1.4.1)
38
- net-http-persistent (3.1.0)
42
+ net-http-persistent (4.0.1)
39
43
  connection_pool (~> 2.2)
40
- nokogiri (1.10.3)
41
- mini_portile2 (~> 2.4.0)
42
- ntlm-http (0.1.1)
43
- parallel (1.17.0)
44
- parser (2.6.3.0)
45
- ast (~> 2.4.0)
46
- public_suffix (3.1.1)
44
+ nokogiri (1.11.2)
45
+ racc (~> 1.4)
46
+ parallel (1.20.1)
47
+ parser (3.0.1.0)
48
+ ast (~> 2.4.1)
49
+ pry (0.13.1)
50
+ coderay (~> 1.1)
51
+ method_source (~> 1.0)
52
+ pry-byebug (3.9.0)
53
+ byebug (~> 11.0)
54
+ pry (~> 0.13.0)
55
+ pry-doc (1.1.0)
56
+ pry (~> 0.11)
57
+ yard (~> 0.9.11)
58
+ public_suffix (4.0.6)
59
+ racc (1.5.2)
47
60
  rainbow (3.0.0)
48
- rake (10.5.0)
49
- rspec (3.8.0)
50
- rspec-core (~> 3.8.0)
51
- rspec-expectations (~> 3.8.0)
52
- rspec-mocks (~> 3.8.0)
53
- rspec-core (3.8.2)
54
- rspec-support (~> 3.8.0)
55
- rspec-expectations (3.8.4)
61
+ rake (13.0.3)
62
+ regexp_parser (2.1.1)
63
+ rexml (3.2.5)
64
+ rspec (3.10.0)
65
+ rspec-core (~> 3.10.0)
66
+ rspec-expectations (~> 3.10.0)
67
+ rspec-mocks (~> 3.10.0)
68
+ rspec-core (3.10.1)
69
+ rspec-support (~> 3.10.0)
70
+ rspec-expectations (3.10.1)
56
71
  diff-lcs (>= 1.2.0, < 2.0)
57
- rspec-support (~> 3.8.0)
58
- rspec-mocks (3.8.1)
72
+ rspec-support (~> 3.10.0)
73
+ rspec-mocks (3.10.2)
59
74
  diff-lcs (>= 1.2.0, < 2.0)
60
- rspec-support (~> 3.8.0)
61
- rspec-support (3.8.2)
75
+ rspec-support (~> 3.10.0)
76
+ rspec-support (3.10.2)
62
77
  rspec_junit_formatter (0.4.1)
63
78
  rspec-core (>= 2, < 4, != 2.12.0)
64
- rubocop (0.73.0)
65
- jaro_winkler (~> 1.5.1)
79
+ rubocop (0.93.1)
66
80
  parallel (~> 1.10)
67
- parser (>= 2.6)
81
+ parser (>= 2.7.1.5)
68
82
  rainbow (>= 2.2.2, < 4.0)
83
+ regexp_parser (>= 1.8)
84
+ rexml
85
+ rubocop-ast (>= 0.6.0)
69
86
  ruby-progressbar (~> 1.7)
70
- unicode-display_width (>= 1.4.0, < 1.7)
71
- rubocop-rspec (1.33.0)
72
- rubocop (>= 0.60.0)
73
- ruby-progressbar (1.10.1)
74
- safe_yaml (1.0.5)
87
+ unicode-display_width (>= 1.4.0, < 2.0)
88
+ rubocop-ast (1.4.1)
89
+ parser (>= 2.7.1.5)
90
+ rubocop-rspec (1.44.1)
91
+ rubocop (~> 0.87)
92
+ rubocop-ast (>= 0.7.1)
93
+ ruby-progressbar (1.11.0)
94
+ rubyntlm (0.6.3)
95
+ simplecov (0.21.2)
96
+ docile (~> 1.1)
97
+ simplecov-html (~> 0.11)
98
+ simplecov_json_formatter (~> 0.1)
99
+ simplecov-html (0.12.3)
100
+ simplecov_json_formatter (0.1.2)
75
101
  unf (0.1.4)
76
102
  unf_ext
77
- unf_ext (0.0.7.6)
78
- unicode-display_width (1.6.0)
79
- vcr (5.0.0)
80
- webmock (3.6.0)
103
+ unf_ext (0.0.7.7)
104
+ unicode-display_width (1.7.0)
105
+ vcr (5.1.0)
106
+ webmock (3.12.2)
81
107
  addressable (>= 2.3.6)
82
108
  crack (>= 0.3.2)
83
109
  hashdiff (>= 0.4.0, < 2.0.0)
110
+ webrick (1.7.0)
84
111
  webrobots (0.1.2)
112
+ yard (0.9.26)
85
113
 
86
114
  PLATFORMS
87
115
  ruby
88
116
 
89
117
  DEPENDENCIES
90
118
  bundler (~> 2.0)
119
+ pry (~> 0.13)
120
+ pry-byebug (~> 3.9)
121
+ pry-doc (~> 1.1)
91
122
  qiita_trend!
92
- rake (~> 10.0)
123
+ rake (~> 13.0)
93
124
  rspec (~> 3.0)
94
- rspec_junit_formatter
125
+ rspec_junit_formatter (~> 0.4)
95
126
  rubocop (~> 0.62)
96
- rubocop-rspec
97
- vcr
98
- webmock
127
+ rubocop-rspec (~> 1.39)
128
+ simplecov (~> 0.18)
129
+ vcr (~> 5.1)
130
+ webmock (~> 3.8)
131
+ yard (~> 0.9)
99
132
 
100
133
  BUNDLED WITH
101
- 2.0.2
134
+ 2.2.4