aua-mite 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8c67f02e730575fcf96ad8ec555f5bb82d1bbaeb
4
+ data.tar.gz: 0e15c405e696e125bf2c1753300e9f13f9b017fa
5
+ SHA512:
6
+ metadata.gz: cce8abc391601e9f4ec04dd12e51888d2e6cf79789f8ef23096bd3aafbe022f29f31bdaf84312434deab71205323b76175eef0d95d9ceb7892e02adb963e0bb4
7
+ data.tar.gz: 199bd25edd5984d9326b1faaf09baa014f5b0901779ee953f079dd235b6dabb816f0a5254ab1f27a188f821381e442d299a899b4c07ea326c59fda75ce3d4932
data/.gitignore CHANGED
@@ -1,3 +1,6 @@
1
1
  pkg/*
2
2
  *.gem
3
3
  .bundle
4
+ .rvmrc
5
+ Gemfile.lock
6
+ tmp/*
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.0.0-p247
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - 1.8.7
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in aua.gemspec
4
4
  gemspec
5
+
6
+ gem "rake"
data/aua-mite.gemspec CHANGED
@@ -18,9 +18,9 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
-
22
- s.add_dependency 'aua', '>= 0.1.0'
23
-
21
+
22
+ s.add_dependency 'aua', '>= 0.2'
23
+
24
24
  s.add_development_dependency 'rspec', '>= 2.4.0'
25
25
  s.add_development_dependency 'guard-rspec', '>=0.1.9'
26
26
  s.add_development_dependency 'growl', '>=1.0.3'
@@ -1,19 +1,19 @@
1
1
  module Aua::Agents::AllMite
2
-
2
+
3
3
  PATTERN = /^All\.mite\-v([\d\.]+)/
4
-
4
+
5
5
  def self.extend?(agent)
6
6
  agent.app =~ PATTERN
7
7
  end
8
-
8
+
9
9
  def type
10
10
  :ApiClient
11
11
  end
12
-
12
+
13
13
  def name
14
14
  @name ||= :"All.mite"
15
15
  end
16
-
16
+
17
17
  def version
18
18
  @version ||= app =~ PATTERN && $1
19
19
  end
@@ -1,29 +1,29 @@
1
1
  module Aua::Agents::Anytime
2
-
2
+
3
3
  def self.extend?(agent)
4
4
  agent.app == "Anytime"
5
5
  end
6
-
6
+
7
7
  def type
8
8
  :ApiClient
9
9
  end
10
-
10
+
11
11
  def name
12
12
  :Anytime
13
13
  end
14
-
14
+
15
15
  def version
16
16
  products[1]
17
17
  end
18
-
18
+
19
19
  def platform
20
20
  @platform ||= app_comments.first =~ /^iPod/ ? :iPod : :iPhone
21
21
  end
22
-
22
+
23
23
  def os_version
24
24
  @os_version ||= $1 if comments[1] && (comments[1][1] || "") =~ /iPhone OS ([\d\.]+)/
25
25
  end
26
-
26
+
27
27
  def os_name
28
28
  :iOS
29
29
  end
@@ -1,13 +1,13 @@
1
1
  module Aua::Agents::Eon
2
-
2
+
3
3
  def self.extend?(agent)
4
4
  agent.app == "Eon"
5
5
  end
6
-
6
+
7
7
  def type
8
8
  :ApiClient
9
9
  end
10
-
10
+
11
11
  def name
12
12
  :Eon
13
13
  end
@@ -1,19 +1,19 @@
1
1
  module Aua::Agents::Fuerst
2
-
2
+
3
3
  PATTERN = /^(DynaMite|GrandTotal|TimeLog)/
4
-
4
+
5
5
  def self.extend?(agent)
6
6
  agent.app =~ PATTERN
7
7
  end
8
-
8
+
9
9
  def type
10
10
  :ApiClient
11
11
  end
12
-
12
+
13
13
  def name
14
14
  @name ||= app.match(PATTERN)[1].to_sym
15
15
  end
16
-
16
+
17
17
  def version
18
18
  @version ||= begin
19
19
  return versions.first if app == "DynaMite" || app == "GrandTotal" || app == "TimeLog"
@@ -0,0 +1,18 @@
1
+ module Aua::Agents::MightyMite
2
+
3
+ def self.extend?(agent)
4
+ agent.app == "MightyMite"
5
+ end
6
+
7
+ def type
8
+ :ApiClient
9
+ end
10
+
11
+ def name
12
+ :MightyMite
13
+ end
14
+
15
+ def version
16
+ @version ||= parts[1] && parts[1][0]
17
+ end
18
+ end
@@ -0,0 +1,25 @@
1
+ module Aua::Agents::Misc
2
+
3
+ CLIENTS = {
4
+ "OpenResearch-Dashboard" => "OpenResearch-Dashboard",
5
+ "Mitey" => "Mitey",
6
+ "my_app_name" => "my_app_name",
7
+ "mite_summary" => "mite_summary"
8
+ }
9
+
10
+ def self.extend?(agent)
11
+ !!CLIENTS[agent.app]
12
+ end
13
+
14
+ def type
15
+ :ApiClient
16
+ end
17
+
18
+ def name
19
+ CLIENTS[app].to_sym
20
+ end
21
+
22
+ def version
23
+ nil
24
+ end
25
+ end
@@ -1,18 +1,18 @@
1
1
  module Aua::Agents::MiteGo
2
-
2
+
3
3
  def self.extend?(agent)
4
- agent.app == "mite.go" &&
4
+ agent.app == "mite.go" &&
5
5
  ((agent.products.index("Darwin") && agent.products[agent.products.index("Darwin")] = "NoDarwin") || true)
6
6
  end
7
-
7
+
8
8
  def type
9
9
  :ApiClient
10
10
  end
11
-
11
+
12
12
  def name
13
13
  @name ||= :"mite.go"
14
14
  end
15
-
15
+
16
16
  def platform
17
17
  @platform ||= begin
18
18
  if app_comments.first =~ /^iPod/
@@ -22,7 +22,7 @@ module Aua::Agents::MiteGo
22
22
  end
23
23
  end
24
24
  end
25
-
25
+
26
26
  def os_version
27
27
  @os_version ||= begin
28
28
  if app_comments[1] =~ /iPhone OS ([\d\.]+)/
@@ -30,7 +30,7 @@ module Aua::Agents::MiteGo
30
30
  end
31
31
  end
32
32
  end
33
-
33
+
34
34
  def os_name
35
35
  :iOS
36
36
  end
@@ -1,25 +1,25 @@
1
1
  module Aua::Agents::StandardMiteClient
2
-
2
+
3
3
  KNOWN_CLIENTS = %w(git2mite Mite-on-rails mite-rb jmite Redmine2mite Mantis2mite Billomat hearttp centralstationcrm mighty-mite-statistics)
4
4
  MITE_STANDARD = /^mite\.([a-z]+)/
5
-
5
+
6
6
  def self.extend?(agent)
7
7
  KNOWN_CLIENTS.include?(agent.app) ||
8
8
  agent.app =~ MITE_STANDARD
9
9
  end
10
-
10
+
11
11
  def type
12
12
  return :HttpChecker if app == "hearttp"
13
13
  :ApiClient
14
14
  end
15
-
15
+
16
16
  def name
17
17
  @name ||= app.to_sym
18
18
  end
19
-
19
+
20
20
  def version
21
21
  return super unless app == "mite.net"
22
22
  versions[2]
23
23
  end
24
-
24
+
25
25
  end
@@ -1,6 +1,8 @@
1
- Dir["#{File.dirname(__FILE__)}/agents/*.rb"].each do |agent|
1
+ Dir["#{File.dirname(__FILE__)}/agents/*.rb"].each do |agent|
2
2
  require(agent)
3
3
  end
4
4
 
5
5
  Aua::Agents.default << Aua::Agents::Fuerst << Aua::Agents::MiteGo <<
6
- Aua::Agents::StandardMiteClient << Aua::Agents::AllMite << Aua::Agents::Anytime << Aua::Agents::Eon
6
+ Aua::Agents::StandardMiteClient << Aua::Agents::AllMite <<
7
+ Aua::Agents::Anytime << Aua::Agents::Eon << Aua::Agents::MightyMite <<
8
+ Aua::Agents::Misc
@@ -1,3 +1,3 @@
1
1
  module AuaMite
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -1,24 +1,24 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe "Mite Extension" do
4
-
4
+
5
5
  EXAMPLES_MITE = {
6
6
  # DynaMite
7
- "DynaMite/2.0.2 CFNetwork/454.11.5 Darwin/10.6.0 (i386) (MacBookPro4%2C1)" =>
7
+ "DynaMite/2.0.2 CFNetwork/454.11.5 Darwin/10.6.0 (i386) (MacBookPro4%2C1)" =>
8
8
  { :type => :ApiClient, :name => :DynaMite, :version => "2.0.2", :os_name => :MacOSX, :os_version => "10.6.6", :platform => :Macintosh },
9
9
  "DynaMite/2.0b5 CFNetwork/454.11.5 Darwin/10.6.0 (i386) (iMac10%2C1)" =>
10
10
  { :type => :ApiClient, :name => :DynaMite, :version => "2.0b5", :os_name => :MacOSX, :os_version => "10.6.6", :platform => :Macintosh },
11
11
  "DynaMite2.0.3 CFNetwork/438.14 Darwin/9.8.0 (i386) (iMac7%2C1)" =>
12
12
  { :type => :ApiClient, :name => :DynaMite, :version => "2.0.3", :os_name => :MacOSX, :os_version => "10.5.8", :platform => :Macintosh },
13
-
13
+
14
14
  # Billomat
15
15
  "Billomat" =>
16
16
  { :type => :ApiClient, :name => :Billomat, :version => nil, :os_name => nil, :os_version => nil, :platform => nil },
17
-
17
+
18
18
  # All.mite
19
19
  "All.mite-v1.4.0.0" =>
20
20
  { :type => :ApiClient, :name => :"All.mite", :version => "1.4.0.0", :os_name => nil, :os_version => nil, :platform => nil },
21
-
21
+
22
22
  # Standard mite clients
23
23
  "mite.php/v1.2" =>
24
24
  { :type => :ApiClient, :name => :"mite.php", :version => "v1.2", :os_name => nil, :os_version => nil, :platform => nil },
@@ -54,23 +54,23 @@ describe "Mite Extension" do
54
54
  { :type => :ApiClient, :name => :"mite.net", :version => "1.2.1.0", :os_name => :Windows, :os_version => "NT 6.1.7600.0", :platform => :Windows },
55
55
  "TimeLog/4.5.7 CFNetwork/454.11.5 Darwin/10.6.0 (i386) (MacBookPro6%2C1)" =>
56
56
  { :type => :ApiClient, :name => :TimeLog, :version => "4.5.7", :os_name => :MacOSX, :os_version => "10.6.6", :platform => :Macintosh },
57
-
57
+
58
58
  # mite.go
59
59
  "mite.go/1.0 CFNetwork/459 Darwin/10.0.0d3" =>
60
60
  { :type => :ApiClient, :name => :"mite.go", :version => "1.0", :os_name => :iOS, :os_version => nil, :platform => :iPhone },
61
61
  "mite.go/1.1 (iPhone1,2; iPhone OS 4.2.1; de)" =>
62
62
  { :type => :ApiClient, :name => :"mite.go", :version => "1.1", :os_name => :iOS, :os_version => "4.2.1", :platform => :iPhone },
63
-
63
+
64
64
  # Anytime
65
65
  "Anytime 1.0 (iPhone Simulator; iPhone OS 4.2; en_US)" =>
66
66
  { :type => :ApiClient, :name => :Anytime, :version => "1.0", :os_name => :iOS, :os_version => "4.2", :platform => :iPhone },
67
67
  "Anytime 1.0 (iPhone; iPhone OS 4.2.1; de_DE)" =>
68
68
  { :type => :ApiClient, :name => :Anytime, :version => "1.0", :os_name => :iOS, :os_version => "4.2.1", :platform => :iPhone },
69
-
69
+
70
70
  # hearttp
71
71
  "hearttp/0.0.1" =>
72
72
  { :type => :HttpChecker, :name => :"hearttp", :version => "0.0.1", :os_name => nil, :os_version => nil, :platform => nil},
73
-
73
+
74
74
  # Eon
75
75
  "Eon/223 CFNetwork/520.3.2 Darwin/11.3.0 (x86_64) (iMac12%2C2)" =>
76
76
  { :type => :ApiClient, :name => :"Eon", :version => "223", :os_name => :Darwin, :os_version => "11.3.0", :platform => :Darwin},
@@ -78,12 +78,26 @@ describe "Mite Extension" do
78
78
  { :type => :ApiClient, :name => :"Eon", :version => "316", :os_name => :Darwin, :os_version => "11.3.0", :platform => :Darwin},
79
79
  "Eon/331 CFNetwork/520.3.2 Darwin/11.3.0 (x86_64) (MacBookPro8%2C2)" =>
80
80
  { :type => :ApiClient, :name => :"Eon", :version => "331", :os_name => :Darwin, :os_version => "11.3.0", :platform => :Darwin},
81
-
81
+
82
82
  # mighty-mite-statistics
83
83
  "mighty-mite-statistics/0.0.1" =>
84
- { :type => :ApiClient, :name => :"mighty-mite-statistics", :version => "0.0.1", :os_name => nil, :os_version => nil, :platform => nil}
84
+ { :type => :ApiClient, :name => :"mighty-mite-statistics", :version => "0.0.1", :os_name => nil, :os_version => nil, :platform => nil},
85
+
86
+ # MightyMite
87
+ "MightyMite 2.3.2 (Macintosh; Mac OS X 10.8.4; de_AT)" =>
88
+ { :type => :ApiClient, :name => :MightyMite, :version => "2.3.2", :os_name => nil, :os_version => nil, :platform => nil},
89
+
90
+ # Misc.
91
+ "OpenResearch-Dashboard" =>
92
+ { :type => :ApiClient, :name => :"OpenResearch-Dashboard", :version => nil, :os_name => nil, :os_version => nil, :platform => nil},
93
+ "Mitey" =>
94
+ { :type => :ApiClient, :name => :Mitey, :version => nil, :os_name => nil, :os_version => nil, :platform => nil},
95
+ "my_app_name" =>
96
+ { :type => :ApiClient, :name => :my_app_name, :version => nil, :os_name => nil, :os_version => nil, :platform => nil},
97
+ "mite_summary" =>
98
+ { :type => :ApiClient, :name => :mite_summary, :version => nil, :os_name => nil, :os_version => nil, :platform => nil},
85
99
  }
86
-
100
+
87
101
  EXAMPLES_MITE.each do |string, values|
88
102
  context "when parsing #{string.inspect}" do
89
103
  let(:user_agent) { Aua.parse(string) }
@@ -94,6 +108,6 @@ describe "Mite Extension" do
94
108
  end
95
109
  end
96
110
  end
97
-
111
+
98
112
  end
99
113
 
metadata CHANGED
@@ -1,71 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aua-mite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
4
+ version: 0.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sebastian Munz
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-03-29 00:00:00.000000000 Z
11
+ date: 2013-07-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: aua
16
- requirement: &2157792260 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
- version: 0.1.0
19
+ version: '0.2'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *2157792260
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0.2'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rspec
27
- requirement: &2157791760 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: 2.4.0
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *2157791760
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 2.4.0
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: guard-rspec
38
- requirement: &2157791300 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ! '>='
45
+ - - '>='
42
46
  - !ruby/object:Gem::Version
43
47
  version: 0.1.9
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *2157791300
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.9
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: growl
49
- requirement: &2157790840 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: 1.0.3
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *2157790840
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 1.0.3
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: rb-fsevent
60
- requirement: &2157790380 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
- - - ! '>='
73
+ - - '>='
64
74
  - !ruby/object:Gem::Version
65
75
  version: 0.3.9
66
76
  type: :development
67
77
  prerelease: false
68
- version_requirements: *2157790380
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: 0.3.9
69
83
  description: Extension for aua (https://github.com/yolk/aua) to recognize custom mite
70
84
  api clients by there user agent string. Not very useful for anyone outside of mite/yolk.
71
85
  But maybe handy as a example of extending aua.
@@ -76,10 +90,10 @@ extensions: []
76
90
  extra_rdoc_files: []
77
91
  files:
78
92
  - .gitignore
79
- - .rvmrc
93
+ - .ruby-version
94
+ - .travis.yml
80
95
  - CHANGES.md
81
96
  - Gemfile
82
- - Gemfile.lock
83
97
  - Guardfile
84
98
  - LICENSE
85
99
  - README.md
@@ -91,6 +105,8 @@ files:
91
105
  - lib/aua-mite/agents/anytime.rb
92
106
  - lib/aua-mite/agents/eon.rb
93
107
  - lib/aua-mite/agents/fuerst.rb
108
+ - lib/aua-mite/agents/mighty_mite.rb
109
+ - lib/aua-mite/agents/misc.rb
94
110
  - lib/aua-mite/agents/mite_go.rb
95
111
  - lib/aua-mite/agents/standard_mite_client.rb
96
112
  - lib/aua-mite/version.rb
@@ -98,27 +114,26 @@ files:
98
114
  - spec/spec_helper.rb
99
115
  homepage: https://github.com/yolk/aua-mite
100
116
  licenses: []
117
+ metadata: {}
101
118
  post_install_message:
102
119
  rdoc_options: []
103
120
  require_paths:
104
121
  - lib
105
122
  required_ruby_version: !ruby/object:Gem::Requirement
106
- none: false
107
123
  requirements:
108
- - - ! '>='
124
+ - - '>='
109
125
  - !ruby/object:Gem::Version
110
126
  version: '0'
111
127
  required_rubygems_version: !ruby/object:Gem::Requirement
112
- none: false
113
128
  requirements:
114
- - - ! '>='
129
+ - - '>='
115
130
  - !ruby/object:Gem::Version
116
131
  version: '0'
117
132
  requirements: []
118
133
  rubyforge_project: aua-mite
119
- rubygems_version: 1.8.10
134
+ rubygems_version: 2.0.3
120
135
  signing_key:
121
- specification_version: 3
136
+ specification_version: 4
122
137
  summary: Extension for aua to recognize custom mite api clients by there user agent
123
138
  string.
124
139
  test_files:
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use ruby-1.9.3@aua-mite --create
data/Gemfile.lock DELETED
@@ -1,44 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- aua-mite (0.0.4)
5
- aua (>= 0.1.0)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- aua (0.2.1)
11
- configuration (1.2.0)
12
- diff-lcs (1.1.2)
13
- growl (1.0.3)
14
- guard (0.3.0)
15
- open_gem (~> 1.4.2)
16
- thor (~> 0.14.6)
17
- guard-rspec (0.1.9)
18
- guard (>= 0.2.2)
19
- launchy (0.3.7)
20
- configuration (>= 0.0.5)
21
- rake (>= 0.8.1)
22
- open_gem (1.4.2)
23
- launchy (~> 0.3.5)
24
- rake (0.8.7)
25
- rb-fsevent (0.3.9)
26
- rspec (2.4.0)
27
- rspec-core (~> 2.4.0)
28
- rspec-expectations (~> 2.4.0)
29
- rspec-mocks (~> 2.4.0)
30
- rspec-core (2.4.0)
31
- rspec-expectations (2.4.0)
32
- diff-lcs (~> 1.1.2)
33
- rspec-mocks (2.4.0)
34
- thor (0.14.6)
35
-
36
- PLATFORMS
37
- ruby
38
-
39
- DEPENDENCIES
40
- aua-mite!
41
- growl (>= 1.0.3)
42
- guard-rspec (>= 0.1.9)
43
- rb-fsevent (>= 0.3.9)
44
- rspec (>= 2.4.0)