diff --git a/.gitignore b/.gitignore index 9f30a35..a292ec9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ pkg/* *.gem .bundle +.rvmrc +Gemfile.lock diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..133fcc5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.0.0-p247 \ No newline at end of file diff --git a/.rvmrc b/.rvmrc deleted file mode 100644 index 77cdde7..0000000 --- a/.rvmrc +++ /dev/null @@ -1 +0,0 @@ -rvm use ruby-1.9.3@aua-mite --create \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dab0ffb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: ruby +rvm: + - 2.0.0 + - 1.9.3 + - 1.8.7 \ No newline at end of file diff --git a/Gemfile b/Gemfile index 2508739..6f927b9 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,5 @@ source "http://rubygems.org" # Specify your gem's dependencies in aua.gemspec gemspec + +gem "rake" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index fa6649d..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,44 +0,0 @@ -PATH - remote: . - specs: - aua-mite (0.0.4) - aua (>= 0.1.0) - -GEM - remote: http://rubygems.org/ - specs: - aua (0.2.1) - configuration (1.2.0) - diff-lcs (1.1.2) - growl (1.0.3) - guard (0.3.0) - open_gem (~> 1.4.2) - thor (~> 0.14.6) - guard-rspec (0.1.9) - guard (>= 0.2.2) - launchy (0.3.7) - configuration (>= 0.0.5) - rake (>= 0.8.1) - open_gem (1.4.2) - launchy (~> 0.3.5) - rake (0.8.7) - rb-fsevent (0.3.9) - rspec (2.4.0) - rspec-core (~> 2.4.0) - rspec-expectations (~> 2.4.0) - rspec-mocks (~> 2.4.0) - rspec-core (2.4.0) - rspec-expectations (2.4.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.4.0) - thor (0.14.6) - -PLATFORMS - ruby - -DEPENDENCIES - aua-mite! - growl (>= 1.0.3) - guard-rspec (>= 0.1.9) - rb-fsevent (>= 0.3.9) - rspec (>= 2.4.0) diff --git a/aua-mite.gemspec b/aua-mite.gemspec index 33516c0..822eeca 100644 --- a/aua-mite.gemspec +++ b/aua-mite.gemspec @@ -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' diff --git a/lib/aua-mite/agents/all_mite.rb b/lib/aua-mite/agents/all_mite.rb index 824e537..5fe4d40 100644 --- a/lib/aua-mite/agents/all_mite.rb +++ b/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 diff --git a/lib/aua-mite/agents/anytime.rb b/lib/aua-mite/agents/anytime.rb index c538100..6a84e76 100644 --- a/lib/aua-mite/agents/anytime.rb +++ b/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 diff --git a/lib/aua-mite/agents/eon.rb b/lib/aua-mite/agents/eon.rb index ada1079..eed7a2a 100644 --- a/lib/aua-mite/agents/eon.rb +++ b/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 diff --git a/lib/aua-mite/agents/fuerst.rb b/lib/aua-mite/agents/fuerst.rb index e145919..e811f7e 100644 --- a/lib/aua-mite/agents/fuerst.rb +++ b/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" diff --git a/lib/aua-mite/agents/mite_go.rb b/lib/aua-mite/agents/mite_go.rb index de11d9d..0aab6ae 100644 --- a/lib/aua-mite/agents/mite_go.rb +++ b/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/ @@ -22,7 +22,7 @@ def platform end end end - + def os_version @os_version ||= begin if app_comments[1] =~ /iPhone OS ([\d\.]+)/ @@ -30,7 +30,7 @@ def os_version end end end - + def os_name :iOS end diff --git a/lib/aua-mite/agents/standard_mite_client.rb b/lib/aua-mite/agents/standard_mite_client.rb index 2e92bfb..30124c0 100644 --- a/lib/aua-mite/agents/standard_mite_client.rb +++ b/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 \ No newline at end of file