fast_woothee 1.4.8 → 1.4.9

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: 4f2a57af2b6fd280f98d5dd6773866f5e8b276d46d47196600485fa9a2ec9755
4
- data.tar.gz: c1e1bd69028c37a7179b313229862173f2a45548cff693dcc9a055c114325459
3
+ metadata.gz: e75a666a76a227c3b697ac8ce454150272e50784cd9ad9623bb580ea498dbd50
4
+ data.tar.gz: 31d41d60e96c3fed523ba20d09d3ec13c40a208df010f464354b428d43d092b6
5
5
  SHA512:
6
- metadata.gz: c3119c9b734a7bd3405a7ddc63fded0ffc29bb278964b98d2f9bb86937091e17bdf3bba89bacfc53b51a639a07f46305cce087a4e345ab6c070805c363576434
7
- data.tar.gz: bbad4ed03bd51dcce5e67f396d026781af645d053f1e91ff64b46f643dd4a467d4bcb7d76dd1d0b6b1f6f9ee9b98e6151b12d1ec0978fa34c965e6d36ef09a3b
6
+ metadata.gz: 86862cd61ef0eef18d444cc733345c9255e40569f5e1b94f4a7c4976abce63a5f06f30f0e0c62ed035573bd8169e38d673ac20e348e8df996e97b3ecbf6dbb86
7
+ data.tar.gz: 72b24944e4f22c919ea01e0c22e17130c0e52cd8112380a14f59596081f0a73ebc7ed1c68665058cc29837ac4771ca569b74d868615a9e29f769ae28e6292fe7
data/.travis.yml CHANGED
@@ -91,7 +91,7 @@ before_install:
91
91
  script:
92
92
  - bundle exec rake spec
93
93
  - bundle exec rake thermite:tarball
94
- - bundle exec rake build
94
+ - bundle exec rake install
95
95
  # - |
96
96
  # if [[ -z "$TRAVIS_TAG" ]]; then
97
97
  # gem uninstall fast_woothee
data/Cargo.lock CHANGED
@@ -8,7 +8,7 @@ dependencies = [
8
8
 
9
9
  [[package]]
10
10
  name = "fast_woothee"
11
- version = "1.4.8"
11
+ version = "1.4.9"
12
12
  dependencies = [
13
13
  "ruru 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
14
14
  "woothee 0.9.0 (git+https://github.com/woothee/woothee-rust)",
data/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "fast_woothee"
3
- version = "1.4.8"
3
+ version = "1.4.9"
4
4
  authors = ["Ian Ker-Seymer <i.kerseymer@gmail.com>"]
5
5
  repository = "https://github.com/ianks/fast_woothee"
6
6
  publish = false
data/README.md CHANGED
@@ -41,6 +41,11 @@ FastWoothee.crawler?("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google
41
41
  FastWoothee.ios?("Mozilla/5.0 (iPhone; CPU iPhone OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B411 Safari/600.1.4") # => true
42
42
  ```
43
43
 
44
+ ```ruby
45
+ # Is the user on Android?
46
+ FastWoothee.android?('Mozilla/5.0 (Linux; Android 9; SM-N960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.105 Mobile Safari/537.36') # => true
47
+ ```
48
+
44
49
  ## Benchmarks
45
50
 
46
51
  ```
data/fast_woothee.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'fast_woothee'
8
- spec.version = '1.4.8'
8
+ spec.version = '1.4.9'
9
9
  spec.authors = ['Ian Ker-Seymer']
10
10
  spec.email = ['i.kerseymer@gmail.com']
11
11
 
@@ -20,8 +20,9 @@ Gem::Specification.new do |spec|
20
20
  spec.bindir = 'exe'
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ['lib']
23
- spec.extensions = ['extconf.rb']
23
+ spec.extensions = ['Rakefile']
24
24
 
25
+ spec.add_runtime_dependency 'thermite', '~> 0'
25
26
 
26
27
  spec.add_development_dependency 'bundler', '~> 2.0'
27
28
  spec.add_development_dependency 'ffi', '~> 1.9'
@@ -30,5 +31,4 @@ Gem::Specification.new do |spec|
30
31
  spec.add_development_dependency 'rake', '~> 10.0'
31
32
  spec.add_development_dependency 'rake-compiler'
32
33
  spec.add_development_dependency 'rspec', '~> 3.0'
33
- spec.add_development_dependency 'thermite', '~> 0'
34
34
  end
data/src/lib.rs CHANGED
@@ -52,6 +52,25 @@ methods!(
52
52
  "iPod" => Boolean::new(true),
53
53
  "iPad" => Boolean::new(true),
54
54
  "iPhone" => Boolean::new(true),
55
+ "iOS" => Boolean::new(true),
56
+ _ => Boolean::new(false)
57
+ }
58
+ }
59
+ }
60
+ }
61
+ );
62
+
63
+ methods!(
64
+ FastWoothee,
65
+ _itself,
66
+ fn is_android(ua_string: RString) -> Boolean {
67
+ let parser = Parser::new();
68
+
69
+ match parser.parse(ua_string.unwrap_or(RString::new("")).to_str()) {
70
+ None => Boolean::new(false),
71
+ Some(result) => {
72
+ match result.os {
73
+ "Android" => Boolean::new(true),
55
74
  _ => Boolean::new(false)
56
75
  }
57
76
  }
@@ -62,9 +81,10 @@ methods!(
62
81
  #[no_mangle]
63
82
  pub extern fn initialize_fast_woothee() {
64
83
  Class::new("FastWoothee", None).define(|itself| {
65
- itself.const_set("VERSION", &RString::new("1.4.8").freeze());
84
+ itself.const_set("VERSION", &RString::new("1.4.9").freeze());
66
85
  itself.def_self("parse", parse);
67
86
  itself.def_self("crawler?", is_crawler);
68
87
  itself.def_self("ios?", is_ios);
88
+ itself.def_self("android?", is_android);
69
89
  });
70
90
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_woothee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.8
4
+ version: 1.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
@@ -10,6 +10,20 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2019-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thermite
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,26 +122,12 @@ dependencies:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
124
  version: '3.0'
111
- - !ruby/object:Gem::Dependency
112
- name: thermite
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
125
  description: Ruby bindings to woothee-rust
126
126
  email:
127
127
  - i.kerseymer@gmail.com
128
128
  executables: []
129
129
  extensions:
130
- - extconf.rb
130
+ - Rakefile
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - ".gitignore"
@@ -142,7 +142,6 @@ files:
142
142
  - Rakefile
143
143
  - bin/console
144
144
  - bin/setup
145
- - extconf.rb
146
145
  - fast_woothee.gemspec
147
146
  - lib/fast_woothee.rb
148
147
  - src/lib.rs
data/extconf.rb DELETED
@@ -1,16 +0,0 @@
1
- if ARGV.include?('--download-binary')
2
- ENV['CARGO'] = '/dev/null'
3
- ARGV.delete('--download-binary')
4
- end
5
-
6
- load File.expand_path('./Rakefile', __dir__)
7
-
8
- Rake::Task['thermite:build'].invoke
9
-
10
- File.open("Makefile", "wb") do |f|
11
- dummy_makefile(".").each do |line|
12
- f.puts(line)
13
- end
14
- end
15
-
16
- $makefile_created = true