Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yolk committed Jul 18, 2013
1 parent 1fc4b4b commit 2cf364e
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 81 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
pkg/*
*.gem
.bundle
.rvmrc
Gemfile.lock
1 change: 1 addition & 0 deletions .ruby-version
@@ -0,0 +1 @@
2.0.0-p247
1 change: 0 additions & 1 deletion .rvmrc

This file was deleted.

5 changes: 5 additions & 0 deletions .travis.yml
@@ -0,0 +1,5 @@
language: ruby
rvm:
- 2.0.0
- 1.9.3
- 1.8.7
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -2,3 +2,5 @@ source "http://rubygems.org"

# Specify your gem's dependencies in aua.gemspec
gemspec

gem "rake"
44 changes: 0 additions & 44 deletions Gemfile.lock

This file was deleted.

6 changes: 3 additions & 3 deletions aua-mite.gemspec
Expand Up @@ -18,9 +18,9 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
s.add_dependency 'aua', '>= 0.1.0'

s.add_dependency 'aua', '>= 0.2'

s.add_development_dependency 'rspec', '>= 2.4.0'
s.add_development_dependency 'guard-rspec', '>=0.1.9'
s.add_development_dependency 'growl', '>=1.0.3'
Expand Down
10 changes: 5 additions & 5 deletions lib/aua-mite/agents/all_mite.rb
@@ -1,19 +1,19 @@
module Aua::Agents::AllMite

PATTERN = /^All\.mite\-v([\d\.]+)/

def self.extend?(agent)
agent.app =~ PATTERN
end

def type
:ApiClient
end

def name
@name ||= :"All.mite"
end

def version
@version ||= app =~ PATTERN && $1
end
Expand Down
14 changes: 7 additions & 7 deletions lib/aua-mite/agents/anytime.rb
@@ -1,29 +1,29 @@
module Aua::Agents::Anytime

def self.extend?(agent)
agent.app == "Anytime"
end

def type
:ApiClient
end

def name
:Anytime
end

def version
products[1]
end

def platform
@platform ||= app_comments.first =~ /^iPod/ ? :iPod : :iPhone
end

def os_version
@os_version ||= $1 if comments[1] && (comments[1][1] || "") =~ /iPhone OS ([\d\.]+)/
end

def os_name
:iOS
end
Expand Down
6 changes: 3 additions & 3 deletions lib/aua-mite/agents/eon.rb
@@ -1,13 +1,13 @@
module Aua::Agents::Eon

def self.extend?(agent)
agent.app == "Eon"
end

def type
:ApiClient
end

def name
:Eon
end
Expand Down
10 changes: 5 additions & 5 deletions lib/aua-mite/agents/fuerst.rb
@@ -1,19 +1,19 @@
module Aua::Agents::Fuerst

PATTERN = /^(DynaMite|GrandTotal|TimeLog)/

def self.extend?(agent)
agent.app =~ PATTERN
end

def type
:ApiClient
end

def name
@name ||= app.match(PATTERN)[1].to_sym
end

def version
@version ||= begin
return versions.first if app == "DynaMite" || app == "GrandTotal" || app == "TimeLog"
Expand Down
14 changes: 7 additions & 7 deletions lib/aua-mite/agents/mite_go.rb
@@ -1,18 +1,18 @@
module Aua::Agents::MiteGo

def self.extend?(agent)
agent.app == "mite.go" &&
agent.app == "mite.go" &&
((agent.products.index("Darwin") && agent.products[agent.products.index("Darwin")] = "NoDarwin") || true)
end

def type
:ApiClient
end

def name
@name ||= :"mite.go"
end

def platform
@platform ||= begin
if app_comments.first =~ /^iPod/
Expand All @@ -22,15 +22,15 @@ def platform
end
end
end

def os_version
@os_version ||= begin
if app_comments[1] =~ /iPhone OS ([\d\.]+)/
$1
end
end
end

def os_name
:iOS
end
Expand Down
12 changes: 6 additions & 6 deletions lib/aua-mite/agents/standard_mite_client.rb
@@ -1,25 +1,25 @@
module Aua::Agents::StandardMiteClient

KNOWN_CLIENTS = %w(git2mite Mite-on-rails mite-rb jmite Redmine2mite Mantis2mite Billomat hearttp centralstationcrm mighty-mite-statistics)
MITE_STANDARD = /^mite\.([a-z]+)/

def self.extend?(agent)
KNOWN_CLIENTS.include?(agent.app) ||
agent.app =~ MITE_STANDARD
end

def type
return :HttpChecker if app == "hearttp"
:ApiClient
end

def name
@name ||= app.to_sym
end

def version
return super unless app == "mite.net"
versions[2]
end

end

0 comments on commit 2cf364e

Please sign in to comment.