tty-platform 0.2.1 → 0.3.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/CHANGELOG.md +6 -0
- data/lib/tty/platform/version.rb +1 -1
- metadata +9 -21
- data/Rakefile +0 -8
- data/spec/spec_helper.rb +0 -45
- data/spec/unit/new_spec.rb +0 -59
- data/spec/unit/platform_spec.rb +0 -65
- data/spec/unit/to_s_spec.rb +0 -9
- data/tasks/console.rake +0 -9
- data/tasks/coverage.rake +0 -11
- data/tasks/spec.rake +0 -29
- data/tty-platform.gemspec +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68cf5229e73b4b200fee23466d04b16f652b2114a8e94a136b57da1e3939ca1a
|
4
|
+
data.tar.gz: 850a3eaf02dc095fe9a2b51c951ba3993a70d6f770ed791bd56cf218c18b967d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7cf04964734d70e6587c76177b89af8fa0fb7fb69f6ea236b908f10efca76ac60b594c2c76541c211207a44e4c7dd7ce631ad4b3fc14ff2e120a0f6dde421be
|
7
|
+
data.tar.gz: 98c434f8101a148465330a57035403998aa211191663d53d3bef938ea4bafc0aa60fea359a5950aba92ec2872132e0961c314bc08fa9b899e151ad105844d5f7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.3.0] - 2020-01-16
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Change gemspec to update metadata and remove test artifacts
|
7
|
+
|
3
8
|
## [v0.2.1] - 2019-06-15
|
4
9
|
|
5
10
|
### Changed
|
@@ -14,6 +19,7 @@
|
|
14
19
|
|
15
20
|
* Initial implementation and release
|
16
21
|
|
22
|
+
[v0.3.0]: https://github.com/piotrmurach/tty-platform/compare/v0.2.1...v0.3.0
|
17
23
|
[v0.2.1]: https://github.com/piotrmurach/tty-platform/compare/v0.2.0...v0.2.1
|
18
24
|
[v0.2.0]: https://github.com/piotrmurach/tty-platform/compare/v0.1.0...v0.2.0
|
19
25
|
[v0.1.0]: https://github.com/piotrmurach/tty-platform/compare/v0.1.0
|
data/lib/tty/platform/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -54,27 +54,19 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
description: Query methods for detecting different operating systems and their properties.
|
56
56
|
email:
|
57
|
-
-
|
57
|
+
- piotr@piotrmurach.com
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
|
-
extra_rdoc_files:
|
60
|
+
extra_rdoc_files:
|
61
|
+
- README.md
|
61
62
|
files:
|
62
63
|
- CHANGELOG.md
|
63
64
|
- LICENSE.txt
|
64
65
|
- README.md
|
65
|
-
- Rakefile
|
66
66
|
- lib/tty-platform.rb
|
67
67
|
- lib/tty/platform.rb
|
68
68
|
- lib/tty/platform/version.rb
|
69
|
-
|
70
|
-
- spec/unit/new_spec.rb
|
71
|
-
- spec/unit/platform_spec.rb
|
72
|
-
- spec/unit/to_s_spec.rb
|
73
|
-
- tasks/console.rake
|
74
|
-
- tasks/coverage.rake
|
75
|
-
- tasks/spec.rake
|
76
|
-
- tty-platform.gemspec
|
77
|
-
homepage: https://github.com/piotrmurach/tty-platform
|
69
|
+
homepage: https://ttytoolkit.org
|
78
70
|
licenses:
|
79
71
|
- MIT
|
80
72
|
metadata:
|
@@ -82,7 +74,7 @@ metadata:
|
|
82
74
|
bug_tracker_uri: https://github.com/piotrmurach/tty-platform/issues
|
83
75
|
changelog_uri: https://github.com/piotrmurach/tty-platform/blob/master/CHANGELOG.md
|
84
76
|
documentation_uri: https://www.rubydoc.info/gems/tty-platform
|
85
|
-
homepage_uri: https://
|
77
|
+
homepage_uri: https://ttytoolkit.org
|
86
78
|
source_code_uri: https://github.com/piotrmurach/tty-platform
|
87
79
|
post_install_message:
|
88
80
|
rdoc_options: []
|
@@ -99,12 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
91
|
- !ruby/object:Gem::Version
|
100
92
|
version: '0'
|
101
93
|
requirements: []
|
102
|
-
rubygems_version: 3.
|
94
|
+
rubygems_version: 3.1.2
|
103
95
|
signing_key:
|
104
96
|
specification_version: 4
|
105
97
|
summary: Query methods for detecting different operating systems and their properties.
|
106
|
-
test_files:
|
107
|
-
- spec/spec_helper.rb
|
108
|
-
- spec/unit/new_spec.rb
|
109
|
-
- spec/unit/platform_spec.rb
|
110
|
-
- spec/unit/to_s_spec.rb
|
98
|
+
test_files: []
|
data/Rakefile
DELETED
data/spec/spec_helper.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
if ENV['COVERAGE'] || ENV['TRAVIS']
|
4
|
-
require 'simplecov'
|
5
|
-
require 'coveralls'
|
6
|
-
|
7
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
8
|
-
SimpleCov::Formatter::HTMLFormatter,
|
9
|
-
Coveralls::SimpleCov::Formatter
|
10
|
-
]
|
11
|
-
|
12
|
-
SimpleCov.start do
|
13
|
-
command_name 'spec'
|
14
|
-
add_filter 'spec'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
require 'tty-platform'
|
19
|
-
|
20
|
-
RSpec.configure do |config|
|
21
|
-
config.expect_with :rspec do |expectations|
|
22
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
23
|
-
end
|
24
|
-
|
25
|
-
config.mock_with :rspec do |mocks|
|
26
|
-
mocks.verify_partial_doubles = true
|
27
|
-
end
|
28
|
-
|
29
|
-
config.filter_run :focus
|
30
|
-
config.run_all_when_everything_filtered = true
|
31
|
-
|
32
|
-
config.disable_monkey_patching!
|
33
|
-
|
34
|
-
config.warnings = true
|
35
|
-
|
36
|
-
if config.files_to_run.one?
|
37
|
-
config.default_formatter = 'doc'
|
38
|
-
end
|
39
|
-
|
40
|
-
config.profile_examples = 2
|
41
|
-
|
42
|
-
config.order = :random
|
43
|
-
|
44
|
-
Kernel.srand config.seed
|
45
|
-
end
|
data/spec/unit/new_spec.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Platform, '#new' do
|
4
|
-
it "detects system properties" do
|
5
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('i686-darwin8.10.1')
|
6
|
-
platform = TTY::Platform.new
|
7
|
-
expect(platform.cpu).to eq('i686')
|
8
|
-
expect(platform.os).to eq('darwin')
|
9
|
-
expect(platform.version).to eq('8.10.1')
|
10
|
-
end
|
11
|
-
|
12
|
-
{
|
13
|
-
# aix
|
14
|
-
'powerpc-aix7.1' => ['powerpc', 'aix', '7.1'],
|
15
|
-
# bitrig
|
16
|
-
'amd64-bitrig1.0' => ['amd64', 'bitrig', '1.0'],
|
17
|
-
'armv7-bitrig1.0' => ['armv7', 'bitrig', '1.0'],
|
18
|
-
'bitrig1.0' => [nil, 'bitrig', '1.0'],
|
19
|
-
# cygwin
|
20
|
-
'i386-cygwin' => ['i386', 'cygwin', nil],
|
21
|
-
# darwin
|
22
|
-
'powerpc-darwin7' => ['powerpc', 'darwin', '7'],
|
23
|
-
'universal-darwin9' => ['universal', 'darwin', '9'],
|
24
|
-
'x86_64-darwin14.0.0' => ['x86_64', 'darwin', '14.0.0'],
|
25
|
-
'x86_64-darwin' => ['x86_64', 'darwin', nil],
|
26
|
-
# freebsd
|
27
|
-
'amd64-freebsd10.1' => ['amd64', 'freebsd', '10.1'],
|
28
|
-
'i386-freebsd10.1' => ['i386', 'freebsd', '10.1'],
|
29
|
-
'i386-freebsd10' => ['i386', 'freebsd', '10'],
|
30
|
-
'i386-freebsd' => ['i386', 'freebsd', nil],
|
31
|
-
'universal-freebsd' => ['universal', 'freebsd', nil],
|
32
|
-
# linux
|
33
|
-
'powerpc-linux' => ['powerpc', 'linux', nil],
|
34
|
-
'i686-linux' => ['i686', 'linux', nil],
|
35
|
-
'x86_64-linux' => ['x86_64', 'linux', nil],
|
36
|
-
'i386-linux-gnu' => ['i386', 'linux', nil],
|
37
|
-
# mswin
|
38
|
-
'i386-mingw32' => ['i386', 'mingw32', nil],
|
39
|
-
'mswin32' => [nil, 'mswin32', nil],
|
40
|
-
'i386-mswin32' => ['i386', 'mswin32', nil],
|
41
|
-
'i386-mswin32_80' => ['i386', 'mswin32', '80'],
|
42
|
-
'i386-mswin32-80' => ['i386', 'mswin32', '80'],
|
43
|
-
# netbsd
|
44
|
-
'i386-netbsdelf' => ['i386', 'netbsdelf', nil],
|
45
|
-
# openbsd
|
46
|
-
'i386-openbsd4.0' => ['i386', 'openbsd', '4.0'],
|
47
|
-
'x86_64-openbsd4.0' => ['x86_64', 'openbsd', '4.0'],
|
48
|
-
# solaris
|
49
|
-
'sparc-solaris2.10' => ['sparc', 'solaris', '2.10'],
|
50
|
-
'i386-solaris2.10' => ['i386', 'solaris', '2.10'],
|
51
|
-
# wince
|
52
|
-
'i386-wince7.0' => ['i386', 'wince', '7.0'],
|
53
|
-
}.each do |arch, expected|
|
54
|
-
it "detectes #{sprintf("%-22s", "'#{arch}'")} as #{expected}" do
|
55
|
-
platform = TTY::Platform.new(arch)
|
56
|
-
expect(platform.to_a).to eq(expected)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
data/spec/unit/platform_spec.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Platform, 'platform' do
|
4
|
-
it "correctly detects windows platform" do
|
5
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('x86-mswin32_60')
|
6
|
-
platform = TTY::Platform.new
|
7
|
-
expect(platform.windows?).to eq(true)
|
8
|
-
end
|
9
|
-
|
10
|
-
it "fails to detect windows" do
|
11
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('unknown')
|
12
|
-
platform = TTY::Platform.new
|
13
|
-
expect(platform.windows?).to eq(false)
|
14
|
-
end
|
15
|
-
|
16
|
-
it "correctly detects windows platform at class level" do
|
17
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('x86-mswin32_60')
|
18
|
-
expect(TTY::Platform.windows?).to eq(true)
|
19
|
-
end
|
20
|
-
|
21
|
-
it "correctly detects linux platform" do
|
22
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('x86_64-linux')
|
23
|
-
platform = TTY::Platform.new
|
24
|
-
expect(platform.linux?).to eq(true)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "fails to detect linux platform" do
|
28
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('unknown')
|
29
|
-
platform = TTY::Platform.new
|
30
|
-
expect(platform.linux?).to eq(false)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "correctly detects linux platform at class level" do
|
34
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('x86_64-linux')
|
35
|
-
expect(TTY::Platform.linux?).to eq(true)
|
36
|
-
end
|
37
|
-
|
38
|
-
it "correctly detects mac platform" do
|
39
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('x86_64-darwin')
|
40
|
-
platform = TTY::Platform.new
|
41
|
-
expect(platform.mac?).to eq(true)
|
42
|
-
end
|
43
|
-
|
44
|
-
it "fails to detect mac platform" do
|
45
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('unknown')
|
46
|
-
platform = TTY::Platform.new
|
47
|
-
expect(platform.mac?).to eq(false)
|
48
|
-
end
|
49
|
-
|
50
|
-
it "correctly detects mac platform at class level" do
|
51
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('x86_64-darwin')
|
52
|
-
expect(TTY::Platform.mac?).to eq(true)
|
53
|
-
end
|
54
|
-
|
55
|
-
it "correctly detects unix platform" do
|
56
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('x86_64-darwin')
|
57
|
-
platform = TTY::Platform.new
|
58
|
-
expect(platform.unix?).to eq(true)
|
59
|
-
end
|
60
|
-
|
61
|
-
it "correctly detects unix platform at class level" do
|
62
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('x86_64-darwin')
|
63
|
-
expect(TTY::Platform.unix?).to eq(true)
|
64
|
-
end
|
65
|
-
end
|
data/spec/unit/to_s_spec.rb
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Platform, '#to_s' do
|
4
|
-
it "display platform information" do
|
5
|
-
allow(RbConfig::CONFIG).to receive(:[]).with('arch').and_return('i686-darwin8.10.1')
|
6
|
-
platform = TTY::Platform.new
|
7
|
-
expect(platform.to_s).to eq('i686-darwin-8.10.1')
|
8
|
-
end
|
9
|
-
end
|
data/tasks/console.rake
DELETED
data/tasks/coverage.rake
DELETED
data/tasks/spec.rake
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
|
6
|
-
desc 'Run all specs'
|
7
|
-
RSpec::Core::RakeTask.new(:spec) do |task|
|
8
|
-
task.pattern = 'spec/{unit,integration}{,/*/**}/*_spec.rb'
|
9
|
-
end
|
10
|
-
|
11
|
-
namespace :spec do
|
12
|
-
desc 'Run unit specs'
|
13
|
-
RSpec::Core::RakeTask.new(:unit) do |task|
|
14
|
-
task.pattern = 'spec/unit{,/*/**}/*_spec.rb'
|
15
|
-
end
|
16
|
-
|
17
|
-
desc 'Run integration specs'
|
18
|
-
RSpec::Core::RakeTask.new(:integration) do |task|
|
19
|
-
task.pattern = 'spec/integration{,/*/**}/*_spec.rb'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
rescue LoadError
|
24
|
-
%w[spec spec:unit spec:integration].each do |name|
|
25
|
-
task name do
|
26
|
-
$stderr.puts "In order to run #{name}, do `gem install rspec`"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/tty-platform.gemspec
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
lib = File.expand_path('../lib', __FILE__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'tty/platform/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "tty-platform"
|
7
|
-
spec.version = TTY::Platform::VERSION
|
8
|
-
spec.authors = ["Piotr Murach"]
|
9
|
-
spec.email = ["me@piotrmurach.com"]
|
10
|
-
spec.summary = %q{Query methods for detecting different operating systems and their properties.}
|
11
|
-
spec.description = %q{Query methods for detecting different operating systems and their properties.}
|
12
|
-
spec.homepage = "https://github.com/piotrmurach/tty-platform"
|
13
|
-
spec.license = "MIT"
|
14
|
-
if spec.respond_to?(:metadata=)
|
15
|
-
spec.metadata = {
|
16
|
-
"allowed_push_host" => "https://rubygems.org",
|
17
|
-
"bug_tracker_uri" => "#{spec.homepage}/issues",
|
18
|
-
"changelog_uri" => "#{spec.homepage}/blob/master/CHANGELOG.md",
|
19
|
-
"documentation_uri" => "https://www.rubydoc.info/gems/tty-platform",
|
20
|
-
"homepage_uri" => spec.homepage,
|
21
|
-
"source_code_uri" => spec.homepage
|
22
|
-
}
|
23
|
-
end
|
24
|
-
spec.files = Dir['{lib,spec}/**/*.rb']
|
25
|
-
spec.files += Dir['{bin,tasks}/*', 'tty-platform.gemspec']
|
26
|
-
spec.files += Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt', 'Rakefile']
|
27
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
29
|
-
spec.require_paths = ["lib"]
|
30
|
-
|
31
|
-
spec.required_ruby_version = '>= 2.0.0'
|
32
|
-
|
33
|
-
spec.add_development_dependency 'bundler', '>= 1.5'
|
34
|
-
spec.add_development_dependency 'rspec', '~> 3.1'
|
35
|
-
spec.add_development_dependency 'rake'
|
36
|
-
end
|