mmi 0.1.1 → 0.1.2

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: 3690e5d4433f8cbc6eff338d6be40704d3d0fd948e18bde447a4ce4ba3118474
4
- data.tar.gz: a235f6d99c7cd9ad1b9cb625aaca38a92dbcf5fa2ea00db12d7ad4334f6d202c
3
+ metadata.gz: 5ab2af6d2ef1d6a8833103c43d7ff51e7d291c5d40bec8a4562bfceec5b29111
4
+ data.tar.gz: f68c381b4c06a325c1083e0ccd8e673c10ff1417877ad6fd71cefa13fe75cc3a
5
5
  SHA512:
6
- metadata.gz: 4ddd69c2c301a5b4807d16a3c34cd6fee60d8ef6109911f27dd6bdaa4facf2ab205f702152172fc3b491ffdccd07ea36988474289c3cca23ea6ac5c18242412a
7
- data.tar.gz: 873a710d0b405512629654525712d3be4719a6da476ea8acbef236f7370a5758417f1cad24beebcd13e4819a28a0153005b08856dbccfc5c90c0709131a9d2fb
6
+ metadata.gz: 23e0d446a545ebe2b0d6051134390b75c45004e96527780d11dd0024abea8e44b819eaf60f101dca6bc8a85752942321ffc1614f186c682d44a05840f11ad496
7
+ data.tar.gz: f8843eee8389f81ccf89fbb5a50b5182d7b3f44f5c54e9745893712a6d7a901e75b9755aa2d508b877aa4a37962f724df6163a4a06b9c71b81ba225a245f31ae
data/lib/mmi.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'semver'
2
1
  require 'open-uri'
3
2
  require 'fileutils'
4
3
  require 'digest'
@@ -1,6 +1,7 @@
1
1
  require 'mmi/modloader/none'
2
2
  require 'mmi/modloader/fabric'
3
3
  require 'mmi/assets_processor'
4
+ require 'mmi/semver'
4
5
 
5
6
  module Mmi
6
7
  class ModFileProcessor
@@ -18,8 +19,8 @@ module Mmi
18
19
  @version = content['version' ]
19
20
  @profile_dir = content['profile_dir'] || Mmi.minecraft_dir
20
21
 
21
- version = SemVer.parse(self.version)
22
- lib_version = SemVer.parse(Mmi::VERSION)
22
+ version = Semver.parse(self.version)
23
+ lib_version = Semver.parse(Mmi::VERSION)
23
24
 
24
25
  if self.version
25
26
  if version.major <= lib_version.major
data/lib/mmi/semver.rb ADDED
@@ -0,0 +1,21 @@
1
+ module Mmi
2
+ class Semver
3
+ attr_accessor :major
4
+ attr_accessor :minor
5
+ attr_accessor :patch
6
+
7
+ def initialize(major, minor, patch)
8
+ self.major = major
9
+ self.minor = minor
10
+ self.patch = patch
11
+ end
12
+
13
+ def self.parse(s)
14
+ if m = /\A(?<major>\d+)(\.(?<minor>\d+))?(\.(?<patch>\d+))?\z/.match(s.strip)
15
+ new(m[:major], m[:minor], m[:patch])
16
+ else
17
+ raise "Version string not in valid format: #{s.inspect}"
18
+ end
19
+ end
20
+ end
21
+ end
data/lib/mmi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mmi
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mmi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - expeehaa
@@ -10,20 +10,6 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2021-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: semver2
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.4'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '3.4'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: github_api
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -112,6 +98,7 @@ files:
112
98
  - lib/mmi/mod_file_processor.rb
113
99
  - lib/mmi/modloader/fabric.rb
114
100
  - lib/mmi/modloader/none.rb
101
+ - lib/mmi/semver.rb
115
102
  - lib/mmi/source/github.rb
116
103
  - lib/mmi/version.rb
117
104
  homepage: https://github.com/expeehaa/mmi