ios-devices 0.3.5 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd5872ec285d0f9c5a6a48be1597de5c48271cf21a1f33603e7b1f455a1f8059
4
- data.tar.gz: 5bc34082e63ba2510b73ca148d7803b3975e8b82f4b44dccf93459024a100b6f
3
+ metadata.gz: d6aaf353aa24266e1ea4d7d671ca687878b7043d2313e209b904f1aacc89d474
4
+ data.tar.gz: 9b5f83d2d3a87964acdab879e648082ae42c5ca34fcc6b6d6a4e7a48af73ceab
5
5
  SHA512:
6
- metadata.gz: adf397677df672f3f68618e06bf2195066ca0d8ecc3a984cdd43c9c9358b43239d23d35ecea6cfafd0f3678fd1aed9a954e5854477172188bbbd5450d4715a96
7
- data.tar.gz: f3c6259ac10a3e083a26314cbcb4036ac84713962d4de2f0ea4e9fdbca289ad165c34854325f5473e529030e6bdba7e8f5b3f2e19100df02dd75d9eecc64a528
6
+ metadata.gz: be1ea9bdb428121177ebf860fae0528cc375fb1ba354876cc52edadcbec3e61580cebf170a7febd0e1191135bf90a16ca63c00766ef745bd19dc544d50d1a217
7
+ data.tar.gz: e513323cb511db4cba55102e98b53a44eaa9cd6bc120d646c1db48e27e8eeeb4815359534cca9c7b751f84b9d09e500b00b3240908ebe003dff7dee158fa716f
data/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ ## 0.4.0 - 2026-10-20
6
+
7
+ - **Require Ruby 3.1 or later.** Ruby 2.6, 2.7 and 3.0 are end-of-life and no longer tested.
8
+ - Ship only the library files, README, LICENSE and CHANGELOG in the packaged gem.
9
+ - Add gem metadata (source code, changelog and bug tracker URIs).
10
+ - Move development dependencies to the Gemfile and drop the unused `pry` and `bundler` ones.
11
+ - Fix the example output in the `Ios::Devices.search` doc comment and remove the dead HockeyApp link.
12
+ - Broaden spec coverage (simulators, unknown and `nil` input, older iPhone, iPad, iPod and Watch models).
13
+ - Document how to add new devices in the README.
14
+ - Add iPhone 17e, iPhone 18 Pro and iPhone 18 Pro Max.
15
+ - Add iPad Air (M2, M3, M4), iPad 11th gen, iPad mini 7 and iPad Pro (M4, M5).
16
+ - Add Apple Watch Series 10, Ultra 3, SE 3 and Series 11.
17
+ - Remove a duplicate "Apple Watch SE 2, 40mm, GPS" entry.
18
+
19
+ ## 0.3.5 - 2025-10-22
20
+
21
+ - Add iPhone 17, iPhone 17 Pro, iPhone 17 Pro Max and iPhone Air.
22
+
23
+ ## 0.3.4 - 2025-02-09
24
+
25
+ - Add iPhone 16 models.
26
+
27
+ For older releases, see the [git tags](https://github.com/rikas/iosdevices/tags).
data/README.md CHANGED
@@ -40,8 +40,36 @@ connection, revision model, etc.
40
40
 
41
41
  device.extra
42
42
  => "GSM"
43
+
44
+ device = Ios::Devices.search('iPhone99,1')
45
+ device.name
46
+ => "Unknown iOS device" # Ios::UNKNOWN_IOS_DEVICE
43
47
  ```
44
48
 
49
+ Simulator identifiers (`i386`, `x86_64`, `arm64`) return `"iOS Simulator"`.
50
+
51
+ ## Adding new devices
52
+
53
+ Device identifiers live in `lib/ios/devices.rb`. When adding new ones:
54
+
55
+ 1. Check the identifiers against at least two of these sources:
56
+ - [AppleDB](https://appledb.dev/device-selection/iPhone.html): identifiers per model, including
57
+ upcoming devices (there are pages for iPad, Apple Watch, etc. too).
58
+ - [EveryMac](https://everymac.com/devices/by-identifier/all-iphone-model-identifiers.html):
59
+ identifiers broken down by regional model number (A-number).
60
+ - [adamawolf's gist](https://gist.github.com/adamawolf/3048717): a plain-text
61
+ `identifier : name` list. Its comments often have new devices first, usually taken from
62
+ Xcode betas, but treat those as unconfirmed.
63
+
64
+ Identifiers for unreleased devices often show up in Xcode betas before Apple ships the
65
+ hardware, and they can change. Prefer adding them after the device is released.
66
+ 2. Follow the naming of the existing entries in the same family (iPhone, iPad, Watch, etc.).
67
+ 3. Make sure the identifier isn't already listed, since a duplicate is silently ignored.
68
+ 4. Add a spec for at least one of the new identifiers in `spec/ios_devices_spec.rb`.
69
+ 5. Add an entry to `CHANGELOG.md` under the upcoming version.
70
+
71
+ Run the tests with `bundle exec rake`.
72
+
45
73
  ## Contributing
46
74
 
47
75
  1. Fork it (https://github.com/rikas/iosdevices/fork)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ios
4
4
  module Devices
5
- VERSION = '0.3.5'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
data/lib/ios/devices.rb CHANGED
@@ -12,13 +12,14 @@ module Ios
12
12
  # Examples:
13
13
  #
14
14
  # Ios::Devices.search('iPhone6,1')
15
- # => #<Ios::Devices::Model:0x007fa55ba1a948 @extra=nil, @name="iPhone 5s", @name="iPhone6,1">
15
+ # => #<Ios::Devices::Model:0x007fa55ba1a948 @device_type="iPhone6,1", @name="iPhone 5s", @extra=nil>
16
16
  #
17
17
  # Ios::Devices.search('iPad2,2')
18
- # => #<Ios::Devices::Model:0x007fa55b957308 @extra="GSM", @name="iPad 2", @name="iPad2,2">
18
+ # => #<Ios::Devices::Model:0x007fa55b957308 @device_type="iPad2,2", @name="iPad 2", @extra="GSM">
19
+ #
20
+ # Unknown device types return a Model named Ios::UNKNOWN_IOS_DEVICE.
19
21
  def self.search(device_type)
20
- # This list was taken from here:
21
- # http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/ios-device-types
22
+ # See "Adding new devices" in the README for sources to check identifiers against.
22
23
  case device_type
23
24
  when 'i386', 'x86_64', 'arm64'
24
25
  Model.new(device_type, 'iOS Simulator')
@@ -128,6 +129,12 @@ module Ios
128
129
  Model.new(device_type, 'iPhone 17')
129
130
  when 'iPhone18,4'
130
131
  Model.new(device_type, 'iPhone Air')
132
+ when 'iPhone18,5'
133
+ Model.new(device_type, 'iPhone 17e')
134
+ when 'iPhone19,2'
135
+ Model.new(device_type, 'iPhone 18 Pro')
136
+ when 'iPhone19,3', 'iPhone19,7'
137
+ Model.new(device_type, 'iPhone 18 Pro Max')
131
138
  when 'iPad1,1'
132
139
  Model.new(device_type, 'iPad')
133
140
  when 'iPad1,2'
@@ -278,6 +285,54 @@ module Ios
278
285
  Model.new(device_type, 'iPad Pro 12.9"', '6th Gen, Wi-Fi')
279
286
  when 'iPad14,6'
280
287
  Model.new(device_type, 'iPad Pro 12.9"', '6th Gen, Wi-Fi+LTE')
288
+ when 'iPad14,8'
289
+ Model.new(device_type, 'iPad Air 11"', 'M2, Wi-Fi')
290
+ when 'iPad14,9'
291
+ Model.new(device_type, 'iPad Air 11"', 'M2, Wi-Fi+LTE')
292
+ when 'iPad14,10'
293
+ Model.new(device_type, 'iPad Air 13"', 'M2, Wi-Fi')
294
+ when 'iPad14,11'
295
+ Model.new(device_type, 'iPad Air 13"', 'M2, Wi-Fi+LTE')
296
+ when 'iPad15,3'
297
+ Model.new(device_type, 'iPad Air 11"', 'M3, Wi-Fi')
298
+ when 'iPad15,4'
299
+ Model.new(device_type, 'iPad Air 11"', 'M3, Wi-Fi+LTE')
300
+ when 'iPad15,5'
301
+ Model.new(device_type, 'iPad Air 13"', 'M3, Wi-Fi')
302
+ when 'iPad15,6'
303
+ Model.new(device_type, 'iPad Air 13"', 'M3, Wi-Fi+LTE')
304
+ when 'iPad15,7'
305
+ Model.new(device_type, 'iPad', '11th gen, Wi-Fi')
306
+ when 'iPad15,8'
307
+ Model.new(device_type, 'iPad', '11th gen, Wi-Fi+LTE')
308
+ when 'iPad16,1'
309
+ Model.new(device_type, 'iPad mini 7', 'Wi-Fi')
310
+ when 'iPad16,2'
311
+ Model.new(device_type, 'iPad mini 7', 'Wi-Fi+LTE')
312
+ when 'iPad16,3'
313
+ Model.new(device_type, 'iPad Pro 11"', 'M4, Wi-Fi')
314
+ when 'iPad16,4'
315
+ Model.new(device_type, 'iPad Pro 11"', 'M4, Wi-Fi+LTE')
316
+ when 'iPad16,5'
317
+ Model.new(device_type, 'iPad Pro 13"', 'M4, Wi-Fi')
318
+ when 'iPad16,6'
319
+ Model.new(device_type, 'iPad Pro 13"', 'M4, Wi-Fi+LTE')
320
+ when 'iPad16,8'
321
+ Model.new(device_type, 'iPad Air 11"', 'M4, Wi-Fi')
322
+ when 'iPad16,9'
323
+ Model.new(device_type, 'iPad Air 11"', 'M4, Wi-Fi+LTE')
324
+ when 'iPad16,10'
325
+ Model.new(device_type, 'iPad Air 13"', 'M4, Wi-Fi')
326
+ when 'iPad16,11'
327
+ Model.new(device_type, 'iPad Air 13"', 'M4, Wi-Fi+LTE')
328
+ when 'iPad17,1'
329
+ Model.new(device_type, 'iPad Pro 11"', 'M5, Wi-Fi')
330
+ when 'iPad17,2'
331
+ Model.new(device_type, 'iPad Pro 11"', 'M5, Wi-Fi+LTE')
332
+ when 'iPad17,3'
333
+ Model.new(device_type, 'iPad Pro 13"', 'M5, Wi-Fi')
334
+ when 'iPad17,4'
335
+ Model.new(device_type, 'iPad Pro 13"', 'M5, Wi-Fi+LTE')
281
336
  when 'iPod1,1'
282
337
  Model.new(device_type, 'iPod touch')
283
338
  when 'iPod2,1'
@@ -354,8 +409,6 @@ module Ios
354
409
  Model.new(device_type, 'Apple Watch', 'Series 7, 45mm, GPS+Cellular')
355
410
  when 'Watch6,10'
356
411
  Model.new(device_type, 'Apple Watch', 'SE 2, 40mm, GPS')
357
- when 'Watch6,10'
358
- Model.new(device_type, 'Apple Watch', 'SE 2, 40mm, GPS')
359
412
  when 'Watch6,11'
360
413
  Model.new(device_type, 'Apple Watch', 'SE 2, 44mm, GPS')
361
414
  when 'Watch6,12'
@@ -382,6 +435,32 @@ module Ios
382
435
  Model.new(device_type, 'Apple Watch', 'Series 9, 45mm, GPS+Cellular')
383
436
  when 'Watch7,5'
384
437
  Model.new(device_type, 'Apple Watch', 'Ultra 2')
438
+ when 'Watch7,8'
439
+ Model.new(device_type, 'Apple Watch', 'Series 10, 42mm, GPS')
440
+ when 'Watch7,9'
441
+ Model.new(device_type, 'Apple Watch', 'Series 10, 46mm, GPS')
442
+ when 'Watch7,10'
443
+ Model.new(device_type, 'Apple Watch', 'Series 10, 42mm, GPS+Cellular')
444
+ when 'Watch7,11'
445
+ Model.new(device_type, 'Apple Watch', 'Series 10, 46mm, GPS+Cellular')
446
+ when 'Watch7,12'
447
+ Model.new(device_type, 'Apple Watch', 'Ultra 3')
448
+ when 'Watch7,13'
449
+ Model.new(device_type, 'Apple Watch', 'SE 3, 40mm, GPS')
450
+ when 'Watch7,14'
451
+ Model.new(device_type, 'Apple Watch', 'SE 3, 44mm, GPS')
452
+ when 'Watch7,15'
453
+ Model.new(device_type, 'Apple Watch', 'SE 3, 40mm, GPS+Cellular')
454
+ when 'Watch7,16'
455
+ Model.new(device_type, 'Apple Watch', 'SE 3, 44mm, GPS+Cellular')
456
+ when 'Watch7,17'
457
+ Model.new(device_type, 'Apple Watch', 'Series 11, 42mm, GPS')
458
+ when 'Watch7,18'
459
+ Model.new(device_type, 'Apple Watch', 'Series 11, 46mm, GPS')
460
+ when 'Watch7,19'
461
+ Model.new(device_type, 'Apple Watch', 'Series 11, 42mm, GPS+Cellular')
462
+ when 'Watch7,20'
463
+ Model.new(device_type, 'Apple Watch', 'Series 11, 46mm, GPS+Cellular')
385
464
  else
386
465
  Model.new(device_type, UNKNOWN_IOS_DEVICE)
387
466
  end
metadata CHANGED
@@ -1,70 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ios-devices
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-27 00:00:00.000000000 Z
11
- dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: bundler
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - ">="
17
- - !ruby/object:Gem::Version
18
- version: '0'
19
- type: :development
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
25
- version: '0'
26
- - !ruby/object:Gem::Dependency
27
- name: pry
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
- type: :development
34
- prerelease: false
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '0'
40
- - !ruby/object:Gem::Dependency
41
- name: rake
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: 13.0.6
47
- type: :development
48
- prerelease: false
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: 13.0.6
54
- - !ruby/object:Gem::Dependency
55
- name: rspec
56
- requirement: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
- type: :development
62
- prerelease: false
63
- version_requirements: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '0'
10
+ date: 2026-10-20 00:00:00.000000000 Z
11
+ dependencies: []
68
12
  description: |-
69
13
  With this gem you can read the device type that every iOS device can send
70
14
  and translate it to a proper model name.
@@ -74,24 +18,19 @@ executables: []
74
18
  extensions: []
75
19
  extra_rdoc_files: []
76
20
  files:
77
- - ".github/workflows/ruby.yml"
78
- - ".gitignore"
79
- - ".rspec"
80
- - ".ruby-version"
81
- - Gemfile
21
+ - CHANGELOG.md
82
22
  - LICENSE.txt
83
23
  - README.md
84
- - Rakefile
85
- - ios-devices.gemspec
86
24
  - lib/ios/devices.rb
87
25
  - lib/ios/devices/model.rb
88
26
  - lib/ios/devices/version.rb
89
- - spec/ios_devices_spec.rb
90
- - spec/spec_helper.rb
91
- homepage: http://github.com/rikas/iosdevices
27
+ homepage: https://github.com/rikas/iosdevices
92
28
  licenses:
93
29
  - MIT
94
- metadata: {}
30
+ metadata:
31
+ source_code_uri: https://github.com/rikas/iosdevices
32
+ changelog_uri: https://github.com/rikas/iosdevices/blob/master/CHANGELOG.md
33
+ bug_tracker_uri: https://github.com/rikas/iosdevices/issues
95
34
  rdoc_options: []
96
35
  require_paths:
97
36
  - lib
@@ -99,7 +38,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
38
  requirements:
100
39
  - - ">="
101
40
  - !ruby/object:Gem::Version
102
- version: '0'
41
+ version: '3.1'
103
42
  required_rubygems_version: !ruby/object:Gem::Requirement
104
43
  requirements:
105
44
  - - ">="
@@ -109,6 +48,4 @@ requirements: []
109
48
  rubygems_version: 3.6.2
110
49
  specification_version: 4
111
50
  summary: iOS device model translation from Apple device types.
112
- test_files:
113
- - spec/ios_devices_spec.rb
114
- - spec/spec_helper.rb
51
+ test_files: []
@@ -1,33 +0,0 @@
1
- ---
2
- # This workflow uses actions that are not certified by GitHub.
3
- # They are provided by a third-party and are governed by
4
- # separate terms of service, privacy policy, and support
5
- # documentation.
6
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
7
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
8
- name: Ruby
9
- on:
10
- push:
11
- branches: [master]
12
- pull_request:
13
- branches: [master]
14
- permissions:
15
- contents: read
16
- jobs:
17
- test:
18
- runs-on: ubuntu-latest
19
- strategy:
20
- matrix:
21
- ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
22
- steps:
23
- - uses: actions/checkout@v4
24
- - name: Set up Ruby
25
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
26
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
27
- # uses: ruby/setup-ruby@v1
28
- uses: ruby/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- bundler-cache: false # runs 'bundle install' and caches installed gems automatically
32
- - name: Run tests
33
- run: bundle install && bundle exec rake
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- *.gem
2
- /.bundle/
3
- /.yardoc
4
- /Gemfile.lock
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
11
- *.bundle
12
- *.so
13
- *.o
14
- *.a
15
- mkmf.log
16
- .DS_Store
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format documentation
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.4.1
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in ios-devices.gemspec
6
- gemspec
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
data/ios-devices.gemspec DELETED
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path('lib', __dir__)
4
-
5
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
-
7
- require 'ios/devices'
8
-
9
- Gem::Specification.new do |spec|
10
- spec.name = 'ios-devices'
11
- spec.version = Ios::Devices::VERSION
12
- spec.authors = ['Ricardo Otero']
13
- spec.email = ['oterosantos@gmail.com']
14
- spec.summary = 'iOS device model translation from Apple device types.'
15
- spec.description = 'With this gem you can read the device type that every iOS device can send
16
- and translate it to a proper model name.'
17
- spec.homepage = 'http://github.com/rikas/iosdevices'
18
- spec.license = 'MIT'
19
-
20
- spec.files = `git ls-files -z`.split("\x0")
21
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
- spec.require_paths = ['lib']
24
-
25
- spec.add_development_dependency 'bundler'
26
- spec.add_development_dependency 'pry'
27
- spec.add_development_dependency 'rake', '~> 13.0.6'
28
- spec.add_development_dependency 'rspec'
29
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe Ios::Devices do
6
- describe '.search' do
7
- subject(:model) { Ios::Devices.search(input) }
8
-
9
- it 'returns a model object' do
10
- model = Ios::Devices.search('iPhone6,2')
11
-
12
- expect(model).to be_a(Ios::Devices::Model)
13
- end
14
-
15
- it 'returns the correct model' do
16
- model = Ios::Devices.search('iPad4,3')
17
-
18
- expect(model.name).to eq('iPad Air')
19
- expect(model.extra).to eq('Rev')
20
- end
21
-
22
- it 'returns a model object with "Unknown iOS device" for unknown device types' do
23
- model = Ios::Devices.search('iPad8,13')
24
-
25
- expect(model.name).to eq('Unknown iOS device')
26
- end
27
-
28
- context 'with Apple Watch5,4' do
29
- let(:input) { 'Watch5,4' }
30
-
31
- it { expect(model.name).to eq('Apple Watch') }
32
- it { expect(model.extra).to eq('Series 5, 44mm, GPS+Cellular') }
33
- end
34
- end
35
- end
data/spec/spec_helper.rb DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'ios/devices'
4
- require 'rspec'
5
-
6
- RSpec.configure do |config|
7
- config.order = 'random'
8
- end