agents 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: 4cb67fbba1de6d9d25fe57c932494d7da9564237ec56cc58555fe2923a7d93c4
4
- data.tar.gz: 40fa474816c93e8811cdd16f73dc96ae96c9de5870ebb64a80a0dcccadb74d8b
3
+ metadata.gz: 9f1fab8b478330155e8019dca067a0da7050fac2cebdcd94874367724a379c9f
4
+ data.tar.gz: d7327fc4d025dd05e36591bb87d6e58e08999bba15768bed577327399fc05988
5
5
  SHA512:
6
- metadata.gz: 0aadbc5acdf5913c03c219dc83184d08d7c3678b030dbfe87a71ba619b9e491b824e0ad6c8ebc7b1d272cfd0f7d6d87999f6d9ff8554d818b7ce96772e3d203c
7
- data.tar.gz: 1a1f368621c3959b90cbd0fb28d5035184b29557e578250cae32aa7d76cec03536ef6d6aca9a20b16b708b885944c93822ce8eb7b15826695d7ebdae91d6c19e
6
+ metadata.gz: e40adcf9b236ed3b83ff15f8f9210ca971ec1ba7c99b61b672a2aaef65cf698e837b01065e6b1bc70635fac92d6bac4807981419f3fde16e47a9ae58b0e8c6ce
7
+ data.tar.gz: 85190edca6fa3c81ec970a35d46176e36da7444b4eb4412d6da1ce671241d1bf91839042aa5678db8033906ffeebe45960d2248cbbd8235b08290e18d2a8a553
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- agents (0.1.1)
4
+ agents (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/agents.rb CHANGED
@@ -6,7 +6,15 @@ module Agents
6
6
  class << self
7
7
  def random_user_agent(*args)
8
8
  args = (args.nil? || args.empty?) ? [:desktop] : args
9
- ::Agents::Constants::USER_AGENTS.dig(*args&.collect(&:to_sym))&.sample
9
+
10
+ case args.first
11
+ when :phone, :mobile
12
+ (::Agents::Constants::USER_AGENTS[:phones][:iphone] | ::Agents::Constants::USER_AGENTS[:phones][:android])&.sample
13
+ when :tablet
14
+ (::Agents::Constants::USER_AGENTS[:tablets][:ipad] | ::Agents::Constants::USER_AGENTS[:tablets][:android])&.sample
15
+ else
16
+ ::Agents::Constants::USER_AGENTS.dig(*args&.collect(&:to_sym))&.sample
17
+ end
10
18
  end
11
19
 
12
20
  def runs_ios?(user_agent)
@@ -1,3 +1,3 @@
1
1
  module Agents
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agents
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
  - Sebastian
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-11 00:00:00.000000000 Z
11
+ date: 2018-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler