factorio-mod 0.5.0 → 0.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f87061c490f02e803b9625ad9ee1430d95ade44ea3ec2aad5f7c4dfe467d964b
4
- data.tar.gz: baf201035dfccf9c0afdd009c86cadc6699fe24c67cfdde6b937909c6982b666
3
+ metadata.gz: '09760ce623f51b194acd38305e43355e35c696cce34be806d9966e3e06053a9b'
4
+ data.tar.gz: d6554dc6838b6b38601f5181f1b995110f6d4b4ee59dd74278c4c1864ebc4e8d
5
5
  SHA512:
6
- metadata.gz: 1f0dbbc1048d6544a6fd1354d13e2b609a58451a7b3a8a28bb33944bc8eb7719d0f3cab94591c8785370be804d87fb71eec446780c8fa0e4bf873e6fdfb6ea41
7
- data.tar.gz: 199ce9af9186305636a6e7bcd8b46d92a3835c992bbb27ecc3f3dc9dc928151a0125b7295b36dac98bd0c4c477010dd942de10ceb093974645d07bcc3740b2f6
6
+ metadata.gz: ec22df0db24cee731ee955125ce1a1ae4a960a73ce390f2cc2a08ca938089526e19df5b51725f295786c4d0aac3f93eba3590d43ff323b8ba1b81d9c9213c516
7
+ data.tar.gz: e5449630eb6774a6a4671c3cd33e77ab203394ab9a2ead354952ada9280e85efd9d8b8c4c01460ce8594134da403121972ad80aa5a30d681d7325fe942d3c633
@@ -1,6 +1,3 @@
1
- variables:
2
- FORCE_LOGIN_ENV: 'true'
3
-
4
1
  before_script:
5
2
  - ruby -v
6
3
  - which ruby
@@ -10,7 +7,41 @@ before_script:
10
7
  rspec:
11
8
  script:
12
9
  - bundle exec rake spec
10
+ variables:
11
+ FORCE_LOGIN_ENV: 'true'
13
12
 
14
13
  rubocop:
15
14
  script:
16
15
  - bundle exec rubocop
16
+
17
+ license_management:
18
+ image:
19
+ name: "registry.gitlab.com/gitlab-org/security-products/license-management:$CI_SERVER_VERSION_MAJOR-$CI_SERVER_VERSION_MINOR-stable"
20
+ entrypoint: [""]
21
+ stage: test
22
+ allow_failure: true
23
+ before_script:
24
+ - echo license_management
25
+ script:
26
+ - /run.sh analyze .
27
+ artifacts:
28
+ paths: [gl-license-management-report.json]
29
+
30
+ dependency_scanning:
31
+ image: docker:stable
32
+ variables:
33
+ DOCKER_DRIVER: overlay2
34
+ allow_failure: true
35
+ services:
36
+ - docker:stable-dind
37
+ before_script:
38
+ - echo dependency_scanning
39
+ script:
40
+ - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
41
+ - docker run
42
+ --env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}"
43
+ --volume "$PWD:/code"
44
+ --volume /var/run/docker.sock:/var/run/docker.sock
45
+ "registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
46
+ artifacts:
47
+ paths: [gl-dependency-scanning-report.json]
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factorio-mod (0.5.0)
4
+ factorio-mod (0.5.1)
5
5
  activesupport (~> 5.2)
6
6
  nokogiri (~> 1.8)
7
7
 
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = "Get the info of Factorio's MOD."
14
14
  spec.homepage = 'https://gitlab.com/71e6fd52/factorio-mod'
15
+ spec.license = 'AGPL-3.0'
15
16
 
16
17
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
17
18
  `git ls-files -z`.split("\x0").reject do |f|
@@ -3,6 +3,8 @@
3
3
  module Factorio
4
4
  # Cache mod info
5
5
  class Cache
6
+ PAGES = %i[information downloads].freeze
7
+
6
8
  attr_reader :cache
7
9
 
8
10
  # @param uri [String] Mod URI like `https://mods.factorio.com/mod/LTN-easier`
@@ -29,6 +31,10 @@ module Factorio
29
31
  # @param better [Symbol] get which page if none of the pages exist.
30
32
  # @return [Nokogiri::HTML]
31
33
  def any(better = :information)
34
+ unless PAGES.include? better
35
+ raise NoPageError, "Page #{better.to_s.capitalize} Not Exist"
36
+ end
37
+
32
38
  if @cache.key? better
33
39
  @cache[better]
34
40
  elsif @cache.any?
@@ -23,4 +23,11 @@ module Factorio
23
23
  super
24
24
  end
25
25
  end
26
+
27
+ # The Exception that try to visit not exist page
28
+ class NoPageError < StandardError
29
+ def initialize(msg)
30
+ super
31
+ end
32
+ end
26
33
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Factorio
4
4
  class Mod
5
- VERSION = '0.5.0'
5
+ VERSION = '0.5.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factorio-mod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 71e6fd52
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-10 00:00:00.000000000 Z
11
+ date: 2018-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,7 +164,8 @@ files:
164
164
  - lib/factorio/mod/mod.rb
165
165
  - lib/factorio/mod/version.rb
166
166
  homepage: https://gitlab.com/71e6fd52/factorio-mod
167
- licenses: []
167
+ licenses:
168
+ - AGPL-3.0
168
169
  metadata: {}
169
170
  post_install_message:
170
171
  rdoc_options: []