deviceify 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/lib/deviceify/version.rb +1 -1
- data/lib/deviceify.rb +9 -1
- data/spec/deviceify_spec.rb +16 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19f03062bd8c03d47988e4dba294c197bc12d0b6
|
4
|
+
data.tar.gz: 73573a0145139994391abca0d08eb4eda2e0998b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c34ac46c85701e2c1b92307d4264bd726863115c080cc1f1323e068ae65007fb51718b2fa7d02eea7e36ae3005e3907710178c71360477e4a536f8afc071178d
|
7
|
+
data.tar.gz: 18e6d4279e6e97fe341116a3772891aa4b1e6753770c06dd9fcee89b5e7f0f635907be71e6042f2455d3ff5cad15effcea3c94a9dd7814ce3315e337689ec90b
|
data/README.md
CHANGED
@@ -19,13 +19,13 @@ Or install it yourself as:
|
|
19
19
|
## Usage
|
20
20
|
|
21
21
|
```Ruby
|
22
|
-
Deviceify
|
23
|
-
=> #<Deviceify::Device:0x007fb9d307c6c0 @name="iPhone", @generation="iPhone 2G", @fcc_ids=["BCGA1203"], @sizes=["4GB", "8GB", "16GB"], @models=["A1203"]>
|
24
|
-
|
25
|
-
Deviceify::Map.name 'iPhone4,1'
|
26
|
-
=> "iPhone 4S"
|
22
|
+
Deviceify.device 'iPhone1,1'
|
23
|
+
=> #<Deviceify::Device:0x007fb9d307c6c0 @name="iPhone", @generation="iPhone 2G", @fcc_ids=["BCGA1203"], @sizes=["4GB", "8GB", "16GB"], @models=["A1203"]>
|
27
24
|
|
28
|
-
Deviceify
|
25
|
+
Deviceify.name 'iPhone4,1'
|
26
|
+
=> "iPhone 4S"
|
27
|
+
|
28
|
+
Deviceify.name 'iPhone9,1'
|
29
29
|
=> "iPhone9,1"
|
30
30
|
```
|
31
31
|
|
data/lib/deviceify/version.rb
CHANGED
data/lib/deviceify.rb
CHANGED
@@ -2,5 +2,13 @@ require "deviceify/version"
|
|
2
2
|
Dir.glob(File.dirname(File.absolute_path(__FILE__)) + '/deviceify/*', &method(:require))
|
3
3
|
|
4
4
|
module Deviceify
|
5
|
-
|
5
|
+
def self.device(identifier)
|
6
|
+
Deviceify::Map.device(identifier)
|
7
|
+
end
|
8
|
+
def self.name(identifier)
|
9
|
+
Deviceify::Map.name(identifier)
|
10
|
+
end
|
11
|
+
def self.devices
|
12
|
+
Deviceify::Map.devices
|
13
|
+
end
|
6
14
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'deviceify' do
|
4
|
+
it 'gets a device' do
|
5
|
+
device = Deviceify.device 'iPhone4,1'
|
6
|
+
device.should_not be_nil
|
7
|
+
end
|
8
|
+
it 'gets a device name' do
|
9
|
+
name = Deviceify.name 'iPhone4,1'
|
10
|
+
name.should == 'iPhone 4S'
|
11
|
+
end
|
12
|
+
it 'returns unknown name' do
|
13
|
+
name = Deviceify.name 'iPhone0,0'
|
14
|
+
name.should == 'iPhone0,0'
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deviceify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Skylar Schipper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/deviceify/map.rb
|
72
72
|
- lib/deviceify/version.rb
|
73
73
|
- spec/device_spec.rb
|
74
|
+
- spec/deviceify_spec.rb
|
74
75
|
- spec/map_spec.rb
|
75
76
|
- spec/spec_helper.rb
|
76
77
|
homepage: ''
|
@@ -99,5 +100,6 @@ specification_version: 4
|
|
99
100
|
summary: Turns device model strings to their human names
|
100
101
|
test_files:
|
101
102
|
- spec/device_spec.rb
|
103
|
+
- spec/deviceify_spec.rb
|
102
104
|
- spec/map_spec.rb
|
103
105
|
- spec/spec_helper.rb
|