ruby-rescuetime 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +16 -0
  3. data/Rakefile +37 -0
  4. data/bin/ruby-rescuetime +6 -0
  5. data/lib/rescuetime.rb +16 -0
  6. data/lib/rescuetime/application.rb +152 -0
  7. data/lib/rescuetime/commands.rb +50 -0
  8. data/lib/rescuetime/config.rb +83 -0
  9. data/lib/rescuetime/debug.rb +18 -0
  10. data/lib/rescuetime/extension.rb +29 -0
  11. data/lib/rescuetime/extensions/chromium.rb +32 -0
  12. data/lib/rescuetime/extensions/gedit.rb +13 -0
  13. data/lib/rescuetime/loop.rb +97 -0
  14. data/lib/rescuetime/uploader.rb +79 -0
  15. data/lib/rescuetime/version.rb +3 -0
  16. data/lib/tasks/ruby-rescuetime_tasks.rake +4 -0
  17. data/test/application_test.rb +12 -0
  18. data/test/dummy/Rakefile +7 -0
  19. data/test/dummy/app/assets/javascripts/application.js +9 -0
  20. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  21. data/test/dummy/app/controllers/application_controller.rb +3 -0
  22. data/test/dummy/app/helpers/application_helper.rb +2 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/test/dummy/config.ru +4 -0
  25. data/test/dummy/config/application.rb +45 -0
  26. data/test/dummy/config/boot.rb +10 -0
  27. data/test/dummy/config/database.yml +25 -0
  28. data/test/dummy/config/environment.rb +5 -0
  29. data/test/dummy/config/environments/development.rb +30 -0
  30. data/test/dummy/config/environments/production.rb +60 -0
  31. data/test/dummy/config/environments/test.rb +39 -0
  32. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  33. data/test/dummy/config/initializers/inflections.rb +10 -0
  34. data/test/dummy/config/initializers/mime_types.rb +5 -0
  35. data/test/dummy/config/initializers/secret_token.rb +7 -0
  36. data/test/dummy/config/initializers/session_store.rb +8 -0
  37. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  38. data/test/dummy/config/locales/en.yml +5 -0
  39. data/test/dummy/config/routes.rb +58 -0
  40. data/test/dummy/db/test.sqlite3 +0 -0
  41. data/test/dummy/log/development.log +0 -0
  42. data/test/dummy/log/test.log +0 -0
  43. data/test/dummy/public/404.html +26 -0
  44. data/test/dummy/public/422.html +26 -0
  45. data/test/dummy/public/500.html +26 -0
  46. data/test/dummy/public/favicon.ico +0 -0
  47. data/test/dummy/script/rails +6 -0
  48. data/test/loop_test.rb +16 -0
  49. data/test/rescuetime_test.rb +8 -0
  50. data/test/test_helper.rb +10 -0
  51. metadata +180 -0
@@ -0,0 +1,39 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'a0f3dbdab7bee1e99a4eadb0b8b4e299908a9135b1317af1e38f4636b2da2f3f56fd454290003279350d3968cc6a057134fd92b8b69163aea2b78db619f68bdd'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,58 @@
1
+ Dummy::Application.routes.draw do
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get 'short'
20
+ # post 'toggle'
21
+ # end
22
+ #
23
+ # collection do
24
+ # get 'sold'
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get 'recent', :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ # root :to => 'welcome#index'
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+ # match ':controller(/:action(/:id(.:format)))'
58
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
data/test/loop_test.rb ADDED
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+
3
+ class Rescuetime::LoopTest < ActiveSupport::TestCase
4
+ test "should not get new object through .new" do
5
+ pending
6
+ assert Rescuetime::Loop.new
7
+ end
8
+
9
+ test "should get Singleton through .create" do
10
+ obj1 = Rescuetime::Loop.create
11
+ obj2 = Rescuetime::Loop.create
12
+
13
+ assert obj1 == obj2
14
+ end
15
+ end
16
+
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class RescuetimeTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert true
6
+ end
7
+ end
8
+
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-rescuetime
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Patrick Helm
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-02-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &71717090 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.1.3
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *71717090
25
+ - !ruby/object:Gem::Dependency
26
+ name: sqlite3
27
+ requirement: &71716870 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *71716870
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ requirement: &71716620 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *71716620
47
+ - !ruby/object:Gem::Dependency
48
+ name: autotest-rails
49
+ requirement: &71716330 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *71716330
58
+ description: ! 'Upload your data to: https://www.rescuetime.com'
59
+ email:
60
+ - deradon87@gmail.com
61
+ executables:
62
+ - ruby-rescuetime
63
+ extensions: []
64
+ extra_rdoc_files: []
65
+ files:
66
+ - bin/ruby-rescuetime
67
+ - lib/rescuetime.rb
68
+ - lib/tasks/ruby-rescuetime_tasks.rake
69
+ - lib/rescuetime/config.rb
70
+ - lib/rescuetime/version.rb
71
+ - lib/rescuetime/loop.rb
72
+ - lib/rescuetime/commands.rb
73
+ - lib/rescuetime/extensions/gedit.rb
74
+ - lib/rescuetime/extensions/chromium.rb
75
+ - lib/rescuetime/debug.rb
76
+ - lib/rescuetime/uploader.rb
77
+ - lib/rescuetime/application.rb
78
+ - lib/rescuetime/extension.rb
79
+ - MIT-LICENSE
80
+ - Rakefile
81
+ - README.rdoc
82
+ - test/application_test.rb
83
+ - test/rescuetime_test.rb
84
+ - test/test_helper.rb
85
+ - test/loop_test.rb
86
+ - test/dummy/db/test.sqlite3
87
+ - test/dummy/config.ru
88
+ - test/dummy/Rakefile
89
+ - test/dummy/log/development.log
90
+ - test/dummy/log/test.log
91
+ - test/dummy/app/views/layouts/application.html.erb
92
+ - test/dummy/app/assets/javascripts/application.js
93
+ - test/dummy/app/assets/stylesheets/application.css
94
+ - test/dummy/app/helpers/application_helper.rb
95
+ - test/dummy/app/controllers/application_controller.rb
96
+ - test/dummy/config/database.yml
97
+ - test/dummy/config/boot.rb
98
+ - test/dummy/config/locales/en.yml
99
+ - test/dummy/config/routes.rb
100
+ - test/dummy/config/environments/production.rb
101
+ - test/dummy/config/environments/test.rb
102
+ - test/dummy/config/environments/development.rb
103
+ - test/dummy/config/initializers/inflections.rb
104
+ - test/dummy/config/initializers/session_store.rb
105
+ - test/dummy/config/initializers/secret_token.rb
106
+ - test/dummy/config/initializers/wrap_parameters.rb
107
+ - test/dummy/config/initializers/mime_types.rb
108
+ - test/dummy/config/initializers/backtrace_silencers.rb
109
+ - test/dummy/config/environment.rb
110
+ - test/dummy/config/application.rb
111
+ - test/dummy/public/404.html
112
+ - test/dummy/public/422.html
113
+ - test/dummy/public/favicon.ico
114
+ - test/dummy/public/500.html
115
+ - test/dummy/script/rails
116
+ homepage: http://www.deckel-gesucht.de
117
+ licenses: []
118
+ post_install_message:
119
+ rdoc_options: []
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ segments:
129
+ - 0
130
+ hash: 111128833
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ! '>='
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ segments:
138
+ - 0
139
+ hash: 111128833
140
+ requirements: []
141
+ rubyforge_project:
142
+ rubygems_version: 1.8.10
143
+ signing_key:
144
+ specification_version: 3
145
+ summary: ruby port of RescueTimeLinuxUploader
146
+ test_files:
147
+ - test/application_test.rb
148
+ - test/rescuetime_test.rb
149
+ - test/test_helper.rb
150
+ - test/loop_test.rb
151
+ - test/dummy/db/test.sqlite3
152
+ - test/dummy/config.ru
153
+ - test/dummy/Rakefile
154
+ - test/dummy/log/development.log
155
+ - test/dummy/log/test.log
156
+ - test/dummy/app/views/layouts/application.html.erb
157
+ - test/dummy/app/assets/javascripts/application.js
158
+ - test/dummy/app/assets/stylesheets/application.css
159
+ - test/dummy/app/helpers/application_helper.rb
160
+ - test/dummy/app/controllers/application_controller.rb
161
+ - test/dummy/config/database.yml
162
+ - test/dummy/config/boot.rb
163
+ - test/dummy/config/locales/en.yml
164
+ - test/dummy/config/routes.rb
165
+ - test/dummy/config/environments/production.rb
166
+ - test/dummy/config/environments/test.rb
167
+ - test/dummy/config/environments/development.rb
168
+ - test/dummy/config/initializers/inflections.rb
169
+ - test/dummy/config/initializers/session_store.rb
170
+ - test/dummy/config/initializers/secret_token.rb
171
+ - test/dummy/config/initializers/wrap_parameters.rb
172
+ - test/dummy/config/initializers/mime_types.rb
173
+ - test/dummy/config/initializers/backtrace_silencers.rb
174
+ - test/dummy/config/environment.rb
175
+ - test/dummy/config/application.rb
176
+ - test/dummy/public/404.html
177
+ - test/dummy/public/422.html
178
+ - test/dummy/public/favicon.ico
179
+ - test/dummy/public/500.html
180
+ - test/dummy/script/rails