inbox 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +18 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +162 -74
  5. data/Rakefile +35 -30
  6. data/VERSION +1 -0
  7. data/example/.gitignore +16 -0
  8. data/example/Gemfile +39 -0
  9. data/example/README.rdoc +28 -0
  10. data/{test/dummy → example}/Rakefile +1 -2
  11. data/{app/views/inbox/emails/index.html.erb → example/app/assets/images/.keep} +0 -0
  12. data/example/app/assets/javascripts/application.js +16 -0
  13. data/example/app/assets/javascripts/welcome.js.coffee +3 -0
  14. data/example/app/assets/stylesheets/application.css +15 -0
  15. data/example/app/assets/stylesheets/welcome.css.scss +3 -0
  16. data/example/app/controllers/application_controller.rb +61 -0
  17. data/{test/dummy/db/development.sqlite3 → example/app/controllers/concerns/.keep} +0 -0
  18. data/{test/dummy → example}/app/helpers/application_helper.rb +0 -0
  19. data/example/app/helpers/welcome_helper.rb +2 -0
  20. data/{test/dummy/db/production.sqlite3 → example/app/mailers/.keep} +0 -0
  21. data/{test/dummy/db/test.sqlite3 → example/app/models/.keep} +0 -0
  22. data/{test/dummy/log/test.log → example/app/models/concerns/.keep} +0 -0
  23. data/example/app/views/layouts/application.html.erb +14 -0
  24. data/example/app/views/welcome/index.html.erb +2 -0
  25. data/example/bin/bundle +3 -0
  26. data/example/bin/rails +8 -0
  27. data/example/bin/rake +8 -0
  28. data/example/bin/spring +18 -0
  29. data/{test/dummy → example}/config.ru +1 -1
  30. data/example/config/application.rb +23 -0
  31. data/example/config/boot.rb +4 -0
  32. data/{test/dummy → example}/config/database.yml +8 -8
  33. data/example/config/environment.rb +5 -0
  34. data/example/config/environments/development.rb +39 -0
  35. data/example/config/environments/production.rb +82 -0
  36. data/example/config/environments/test.rb +41 -0
  37. data/example/config/initializers/assets.rb +8 -0
  38. data/{test/dummy → example}/config/initializers/backtrace_silencers.rb +1 -1
  39. data/example/config/initializers/cookies_serializer.rb +3 -0
  40. data/example/config/initializers/filter_parameter_logging.rb +4 -0
  41. data/example/config/initializers/inflections.rb +16 -0
  42. data/{test/dummy → example}/config/initializers/mime_types.rb +0 -1
  43. data/example/config/initializers/session_store.rb +3 -0
  44. data/{test/dummy → example}/config/initializers/wrap_parameters.rb +6 -6
  45. data/example/config/locales/en.yml +23 -0
  46. data/example/config/routes.rb +59 -0
  47. data/example/config/secrets.yml +22 -0
  48. data/example/db/seeds.rb +7 -0
  49. data/{test/dummy/public/favicon.ico → example/lib/assets/.keep} +0 -0
  50. data/example/lib/tasks/.keep +0 -0
  51. data/example/log/.keep +0 -0
  52. data/example/public/404.html +67 -0
  53. data/example/public/422.html +67 -0
  54. data/example/public/500.html +66 -0
  55. data/example/public/favicon.ico +0 -0
  56. data/example/public/robots.txt +5 -0
  57. data/example/test/controllers/.keep +0 -0
  58. data/example/test/controllers/welcome_controller_test.rb +9 -0
  59. data/example/test/fixtures/.keep +0 -0
  60. data/example/test/fixtures/users.yml +11 -0
  61. data/example/test/helpers/.keep +0 -0
  62. data/example/test/helpers/welcome_helper_test.rb +4 -0
  63. data/example/test/integration/.keep +0 -0
  64. data/example/test/mailers/.keep +0 -0
  65. data/example/test/models/.keep +0 -0
  66. data/{test/integration/navigation_test.rb → example/test/models/user_test.rb} +1 -4
  67. data/example/test/test_helper.rb +10 -0
  68. data/example/vendor/assets/javascripts/.keep +0 -0
  69. data/example/vendor/assets/stylesheets/.keep +0 -0
  70. data/inbox.gemspec +327 -0
  71. data/lib/contact.rb +10 -0
  72. data/lib/draft.rb +28 -0
  73. data/lib/file.rb +31 -0
  74. data/lib/inbox.rb +81 -20
  75. data/lib/message.rb +37 -0
  76. data/lib/namespace.rb +51 -0
  77. data/lib/restful_model.rb +76 -0
  78. data/lib/restful_model_collection.rb +131 -0
  79. data/lib/tag.rb +9 -0
  80. data/lib/thread.rb +60 -0
  81. data/lib/version.rb +3 -0
  82. data/spec/inbox_spec.rb +79 -0
  83. data/spec/restful_model_spec.rb +18 -0
  84. data/spec/spec_helper.rb +1 -0
  85. data/tasks/rspec.rake +3 -0
  86. metadata +1038 -181
  87. data/MIT-LICENSE +0 -20
  88. data/app/assets/images/inbox/results_bg.png +0 -0
  89. data/app/assets/images/inbox/tree_bg.png +0 -0
  90. data/app/assets/javascripts/inbox/application.js +0 -8
  91. data/app/assets/javascripts/inbox/emails.js +0 -2
  92. data/app/assets/stylesheets/inbox/application.css +0 -7
  93. data/app/assets/stylesheets/inbox/emails.css +0 -59
  94. data/app/assets/stylesheets/inbox/panel.css.erb +0 -229
  95. data/app/assets/stylesheets/inbox/reset.css +0 -53
  96. data/app/controllers/inbox/application_controller.rb +0 -4
  97. data/app/controllers/inbox/emails_controller.rb +0 -52
  98. data/app/helpers/inbox/application_helper.rb +0 -4
  99. data/app/helpers/inbox/emails_helper.rb +0 -4
  100. data/app/mailers/inbox/email_mailer.rb +0 -11
  101. data/app/models/inbox/email.rb +0 -51
  102. data/app/views/inbox/emails/new.html.erb +0 -9
  103. data/app/views/inbox/emails/show.html.erb +0 -48
  104. data/app/views/layouts/inbox/application.html.erb +0 -15
  105. data/app/views/layouts/inbox/inbox.html.erb +0 -25
  106. data/config/routes.rb +0 -6
  107. data/lib/inbox/engine.rb +0 -9
  108. data/lib/inbox/version.rb +0 -3
  109. data/lib/tasks/inbox_tasks.rake +0 -4
  110. data/test/dummy/app/assets/javascripts/application.js +0 -9
  111. data/test/dummy/app/assets/stylesheets/application.css +0 -7
  112. data/test/dummy/app/controllers/application_controller.rb +0 -3
  113. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  114. data/test/dummy/config/application.rb +0 -45
  115. data/test/dummy/config/boot.rb +0 -10
  116. data/test/dummy/config/environment.rb +0 -5
  117. data/test/dummy/config/environments/development.rb +0 -32
  118. data/test/dummy/config/environments/production.rb +0 -60
  119. data/test/dummy/config/environments/test.rb +0 -42
  120. data/test/dummy/config/initializers/inflections.rb +0 -10
  121. data/test/dummy/config/initializers/secret_token.rb +0 -7
  122. data/test/dummy/config/initializers/session_store.rb +0 -8
  123. data/test/dummy/config/locales/en.yml +0 -5
  124. data/test/dummy/config/routes.rb +0 -4
  125. data/test/dummy/log/development.log +0 -3641
  126. data/test/dummy/public/404.html +0 -26
  127. data/test/dummy/public/422.html +0 -26
  128. data/test/dummy/public/500.html +0 -26
  129. data/test/dummy/script/rails +0 -6
  130. data/test/dummy/tmp/cache/assets/C4D/8B0/sprockets%2F5e1b589842222e2ea0043890c2c84539 +0 -0
  131. data/test/dummy/tmp/cache/assets/C6F/5C0/sprockets%2F259fb59d511a70d46436201b6770a04a +0 -0
  132. data/test/dummy/tmp/cache/assets/CF2/F90/sprockets%2F5378bb2470df984ccf2643991a6e476d +0 -0
  133. data/test/dummy/tmp/cache/assets/D0B/330/sprockets%2F582a2b19d6be92a0393afa63894d721a +0 -0
  134. data/test/dummy/tmp/cache/assets/D1B/CE0/sprockets%2F09c9c18794df089e62443d3debb117e5 +0 -0
  135. data/test/dummy/tmp/cache/assets/D1D/BA0/sprockets%2F29888f599d35bb11e4a8183d6dc5e23a +0 -0
  136. data/test/dummy/tmp/cache/assets/D1F/600/sprockets%2Fdd3578c9bd0719efe092c59655a25c55 +0 -0
  137. data/test/dummy/tmp/cache/assets/D21/920/sprockets%2F85fd59fe11746a33f5f917a923d84be3 +0 -0
  138. data/test/dummy/tmp/cache/assets/D4D/FB0/sprockets%2Fd5743837e8babdab4825364c4ee86f73 +0 -0
  139. data/test/dummy/tmp/cache/assets/D4F/520/sprockets%2F88ecb483df9e177ee775202ba0691ec7 +0 -0
  140. data/test/dummy/tmp/cache/assets/D6E/300/sprockets%2Fcc54b61039f74d6b8a2a7d04ad9d77f0 +0 -0
  141. data/test/dummy/tmp/cache/assets/D74/390/sprockets%2F5eda33e637dd54ff6a27bb76c482a473 +0 -0
  142. data/test/dummy/tmp/cache/assets/D76/170/sprockets%2Ffa5e461b362e11c80d5fd9e877fb63e2 +0 -0
  143. data/test/dummy/tmp/cache/assets/D7F/2D0/sprockets%2F141c2c9cb5235c8d21a00fbc8d7a2ab1 +0 -0
  144. data/test/dummy/tmp/cache/assets/D84/AA0/sprockets%2F5e841fe9d79e3ebf4333be8842b77bc5 +0 -0
  145. data/test/dummy/tmp/cache/assets/DA0/520/sprockets%2Fb8e93a54478c1f1a0e750ef2cbf74f3c +0 -0
  146. data/test/dummy/tmp/cache/assets/DC1/520/sprockets%2Feb8cea402f0bf04560adcd0cb8807b88 +0 -0
  147. data/test/dummy/tmp/mails/1345541756.4616725 +0 -11
  148. data/test/functional/inbox/email_test.rb +0 -9
  149. data/test/functional/inbox/emails_controller_test.rb +0 -16
  150. data/test/inbox_test.rb +0 -7
  151. data/test/test_helper.rb +0 -10
  152. data/test/unit/helpers/inbox/emails_helper_test.rb +0 -6
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: abe056c1b96943e3cddcb3b5ec95094ad07088f8
4
+ data.tar.gz: 71e10c1505539c294f862265799608ec30b839aa
5
+ SHA512:
6
+ metadata.gz: 36b4a7954a470d684038e56992795608fa244ca9a121b07b7d064aa60e76e689970ef270b34c7357a1c1bb21fb1aaeeb53ce5700dbfecd7bfd4e973c0b519a82
7
+ data.tar.gz: 42224c275e7beff0a84543729f49c82b102728599c5660a6132b91af541e4f0a78884dd286b55b98ccf1bde40156a39ca511ea62a5ed0d16df94b4e2fad3a300
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+
4
+ gem 'rest-client', '~> 1.6.8'
5
+ gem 'activesupport', '~> 4.1.4'
6
+
7
+ # Add dependencies to develop your gem here.
8
+ # Include everything needed to run rake, tests, features, etc.
9
+ group :development, :test do
10
+ gem 'rspec'
11
+ gem "shoulda", ">= 0"
12
+ gem "rdoc", "~> 3.12"
13
+ gem "bundler", ">= 1.3.5"
14
+ gem "jeweler", "~> 1.8.4"
15
+ gem 'pry'
16
+ gem 'pry-nav'
17
+ gem 'pry-stack_explorer'
18
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+ ----
3
+
4
+ Copyright (c) 2014 InboxApp, Inc. and Contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,126 +1,214 @@
1
- Inbox
2
- =====
1
+ # Inbox Ruby bindings
3
2
 
3
+ ## Installation
4
4
 
5
- Description
6
- -----------
5
+ Add this line to your application's Gemfile:
7
6
 
8
- * Preview send emails in development and test mode.
7
+ gem 'inbox'
9
8
 
10
- * Test them using your standard Capybara matchers or
11
- any other testing framework that you prefer.
9
+ And then execute:
12
10
 
11
+ bundle
13
12
 
14
- Installation
15
- ------------
13
+ You don't need to use this repo unless you're planning to modify the gem. If you just want to use the Inbox SDK with Ruby bindings, you should run:
16
14
 
17
- In your `Gemfile` add:
15
+ gem install inbox
18
16
 
19
- ```ruby
20
- gem 'inbox'
21
- ```
22
17
 
23
- And run:
18
+ ##Requirements
24
19
 
25
- ```
26
- bundle install
27
- ```
20
+ - Ruby 1.8.7 or above. (Ruby 1.8.6 may work if you load ActiveSupport.)
21
+
22
+ - rest-client, json
23
+
24
+
25
+ ## Example
26
+
27
+ A small example Rails app is included in the `example` directory. You can run the sample app to see how an authentication flow might be implemented.
28
+
29
+ `cd example`
28
30
 
31
+ `RESTCLIENT_LOG=stdout rails s`
29
32
 
30
- Setup
31
- -----
33
+ *Note that you will need to replace the Inbox App ID and Secret in `config/environments/development.rb` to use the sample app.*
32
34
 
33
- Mount engine in `config/routes.rb`
35
+ ## Usage
34
36
 
35
- ```ruby
36
- Rails.application.routes.draw do
37
- mount Inbox::Engine => "/inbox"
37
+ ### App ID and Secret
38
+
39
+ Before you can interact with the Inbox API, you need to register for the Inbox developer program at [http://www.inboxapp.com/](http://www.inboxapp.com/). After you've created a developer account, you can create a new application to generate an App ID / Secret pair.
40
+
41
+ ### Authentication
42
+
43
+ The Inbox API uses server-side (three-legged) OAuth, and the Ruby gem provides a convenience methods that simplify the OAuth process. For more information about authenticating with Inbox, visit the [Developer Documentation](https://www.inboxapp.com/docs/gettingstarted-hosted#authenticating).
44
+
45
+ **Step 1: Redirect the user to Inbox:**
46
+
47
+ ```
48
+ :::ruby
49
+ require 'inbox'
50
+
51
+ def login
52
+ inbox = Inbox::API.new(config.inbox_app_id, config.inbox_app_secret, nil)
53
+ # The email address of the user you want to authenticate
54
+ user_email = 'ben@inboxapp.com'
55
+
56
+ # This URL must be registered with your application in the developer portal
57
+ callback_url = url_for(:action => 'login_callback')
58
+
59
+ redirect_to inbox.url_for_authentication(callback_url, user_email)
38
60
  end
39
61
  ```
40
62
 
41
- Feel free to mount it under different route
42
- if this one is already taken in your application
63
+ **Step 2: Handle the Authentication Response:**
43
64
 
44
- ```ruby
45
- mount Inbox::Engine => "/mailer"
46
65
  ```
66
+ :::ruby
67
+ def login_callback
68
+ inbox = Inbox::API.new(config.inbox_app_id, config.inbox_app_secret, nil)
69
+ inbox_token = inbox.auth_token_for_code(params[:code])
47
70
 
71
+ # Save the inbox_token to the current session, save it to the user model, etc.
72
+ end
73
+ ```
48
74
 
49
- Usage
50
- -----
75
+ ### Fetching Namespaces
51
76
 
52
- ### Manual
77
+ ```
78
+ :::ruby
79
+ inbox = Inbox::API.new(config.inbox_app_id, config.inbox_app_secret, inbox_token)
53
80
 
54
- Navigate to `/inbox/<email>/emails` ex.: `/inbox/robert.pankowecki@gmail.com/emails`
55
- to see a list of emails that would have been delivered to the user.
81
+ # Get the first namespace
82
+ namespace = inbox.namespaces.first
56
83
 
57
- Click subject of the email to see its content
84
+ # Print out the email address and provider (Gmail, Exchange)
85
+ puts namespace.email_address
86
+ puts namespace.provider
87
+ ```
58
88
 
59
- ### Testing framework
60
89
 
61
- In [capybara](https://github.com/jnicklas/capybara/) or [bbq](https://github.com/drugpl/bbq)
90
+ ### Fetching Threads
62
91
 
63
- ```ruby
64
- visit("/inbox/robert.pankowecki@gmail.com/emails")
65
- click_link("Subject of the email")
66
- has_content?("This should be in email")
67
- click_link("Some link in the email ex. account activation link")
68
92
  ```
93
+ :::ruby
94
+ # Fetch the first thread
95
+ thread = namespace.threads.first
96
+
97
+ # Fetch a specific thread
98
+ thread = namespace.threads.find('ac123acd123ef123')
99
+
100
+ # List all threads tagged `inbox`
101
+ # (paginating 50 at a time until no more are returned.)
102
+ namespace.threads.where(:tag => 'inbox').each do |thread|
103
+ puts thread.subject
104
+ end
105
+
106
+ # List the 5 most recent unread threads
107
+ namespace.threads.where(:tag => 'unread').range(0,4).each do |thread|
108
+ puts thread.subject
109
+ end
110
+
111
+ # List all threads with 'ben@inboxapp.com'
112
+ namespace.threads.where(:any_email => 'ben@inboxapp.com').each do |thread|
113
+ puts thread.subject
114
+ end
115
+
116
+ # Collect all threads with 'ben@inboxapp.com' into an array.
117
+ # Note: for large numbers of threads, this is not advised.
118
+ threads = namespace.threads.where(:any_email => 'ben@inboxapp.com').all
119
+ ```
120
+
69
121
 
70
- The nice thing is that this is just HTML page displaying email content so you can use
71
- your favorite testing framework (`BBQ`, `Capybara`, `Test::Unit`, `Spinach`, `Cucumber`, `RSpec`, whatever)
72
- for checking the content of page. And you can reuse your matchers.
122
+ ### Working with Threads
73
123
 
124
+ ```
125
+ :::ruby
126
+ # List thread participants
127
+ thread.participants.each do |participant|
128
+ puts participant['email']
129
+ end
74
130
 
75
- ### Sending
131
+ # Mark as read
132
+ thread.mark_as_read!
76
133
 
77
- Navigate to `/inbox/<email>/emails/new` ex.: `/inbox/robert.pankowecki@gmail.com/emails/new`
78
- to see an ugly form for sending emails that you can use to play around and see if everything
79
- works fine.
134
+ # Archive
135
+ thread.archive!
80
136
 
81
- ### Clear send emails
137
+ # Add or remove arbitrary tags
138
+ tagsToAdd = ['inbox', 'cfa1233ef123acd12']
139
+ tagsToRemove = []
140
+ thread.update_tags!(tagsToAd, tagsToRemove)
82
141
 
83
- ```ruby
84
- ActionMailer::Base.deliveries.clear # in :test mode
85
- Inbox::FileDelivery.new(ActionMailer::Base.inbox_settings).clear # in :inbox mode
142
+ # List messages
143
+ thread.messages.each do |message|
144
+ puts message.subject
145
+ end
86
146
  ```
87
147
 
88
- Async (distributed / queue)
89
- ---------------------------
90
148
 
91
- In case you want to have acceptance tests of emails that are
92
- sent using external process (`resque`, `sidekiq`, ...) just set
149
+ ### Working with Files
150
+
151
+ ```
152
+ :::ruby
153
+ # List files
154
+ namespace.files.each do |file|
155
+ puts file.filename
156
+ end
93
157
 
94
- ```ruby
95
- config.action_mailer.delivery_method = :inbox
158
+ # Create a new file
159
+ file = namespace.files.build(:file => File.new("./public/favicon.ico", 'rb'))
160
+ file.save!
96
161
  ```
97
162
 
98
- in `config/environments/test.rb` and create `tmp/mails` directory.
163
+ ### Working with Messages, Contacts, etc.
164
+
165
+ Each of the primary collections (contacts, messages, etc.) behave the same way as `threads`. For example, finding messages with a filter is similar to finding threads:
166
+
167
+ ```
168
+ :::ruby
169
+ messages = namespace.messages.where(:to => 'ben@inboxapp.com`).all
170
+ ```
99
171
 
172
+ The `where` method accepts a hash of filters, as documented in the [Inbox Filters Documentation](https://www.inboxapp.com/docs/api#filters).
100
173
 
101
- If you send emails from your Rails models, controllers, services or use-cases you can stick with:
174
+ ### Creating and Sending Drafts
102
175
 
103
- ```ruby
104
- config.action_mailer.delivery_method = :test
105
176
  ```
177
+ :::ruby
178
+ # Create a new draft
179
+ draft = namespace.drafts.build(
180
+ :to => [{:name => 'Ben Gotow', :email => 'ben@inboxapp.com'}],
181
+ :subject => "Sent by Ruby",
182
+ :body => "Hi there!<strong>This is HTML</strong>"
183
+ )
184
+
185
+ # Modify attributes as necessary
186
+ draft.cc = [{:name => 'Michael', :email => 'mg@inboxapp.com'}]
187
+
188
+ # Add the file we uploaded as an attachment
189
+ draft.attach(file)
190
+
191
+ # Save the draft
192
+ draft.save!
193
+
194
+ # Send the draft. This method returns immediately and queues the message
195
+ # with Inbox for delivery through the user's SMTP gateway.
196
+ draft.send!
197
+ ```
198
+
106
199
 
200
+ ## Contributing
107
201
 
108
- Look & Feel
109
- -----------
202
+ We'd love your help making the Inbox ruby gem better. Join the Google Group for project updates and feature discussion. We also hang out in `##inbox` on [irc.freenode.net](http://irc.freenode.net), or you can email [help@inboxapp.com](mailto:help@inboxapp.com).
110
203
 
111
- ![Inbox gem look and feel](http://img832.imageshack.us/img832/1333/screenshotinboxgooglech.png)
204
+ Please sign the Contributor License Agreement before submitting pull requests. (It's similar to other projects, like NodeJS or Meteor.)
112
205
 
206
+ The Inbox ruby gem uses [Jeweler](https://github.com/technicalpickles/jeweler) for release management. When you're ready to release a new version, do something like this:
113
207
 
114
- Inspirations
115
- ------------
208
+ rake version:bump:minor
209
+ rake release
116
210
 
117
- * [https://github.com/37signals/mail_view](https://github.com/37signals/mail_view)
118
- * [https://github.com/ryanb/letter_opener](https://github.com/ryanb/letter_opener)
119
- * [https://github.com/suhrawardi/capybara_email/](https://github.com/suhrawardi/capybara_email/)
120
- * [https://github.com/pawelpacana/mail_inbox/](https://github.com/pawelpacana/mail_inbox/)
121
- * [http://api.rubyonrails.org/](http://api.rubyonrails.org/)
211
+ Tests can be run with:
122
212
 
123
- License
124
- -------
213
+ rspec spec
125
214
 
126
- MIT-LICENSE
data/Rakefile CHANGED
@@ -1,39 +1,44 @@
1
- #!/usr/bin/env rake
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
2
5
  begin
3
- require 'bundler/setup'
4
- rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
6
11
  end
7
- begin
8
- require 'rdoc/task'
9
- rescue LoadError
10
- require 'rdoc/rdoc'
11
- require 'rake/rdoctask'
12
- RDoc::Task = Rake::RDocTask
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "inbox"
18
+ gem.homepage = "http://github.com/inboxapp/inbox-ruby"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Gem for interacting with the Inbox API}
21
+ gem.description = %Q{Gem for interacting with the Inbox API that allows you to create and publish one-page websites, subscribe to web hooks and receive events when those pages are interacted with. Visit http://www.populr.me/ for more information. }
22
+ gem.email = "ben@inboxapp.com"
23
+ gem.authors = ["Ben Gotow"]
24
+ # dependencies defined in Gemfile
13
25
  end
26
+ Jeweler::RubygemsDotOrgTasks.new
14
27
 
15
- RDoc::Task.new(:rdoc) do |rdoc|
16
- rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = 'Inbox'
18
- rdoc.options << '--line-numbers'
19
- rdoc.rdoc_files.include('README.rdoc')
20
- rdoc.rdoc_files.include('lib/**/*.rb')
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
21
33
  end
22
34
 
23
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
- load 'rails/tasks/engine.rake'
25
-
26
35
 
27
- Bundler::GemHelper.install_tasks
36
+ require 'rdoc/task'
37
+ Rake::RDocTask.new do |rdoc|
38
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
28
39
 
29
- require 'rake/testtask'
30
-
31
- Rake::TestTask.new(:test) do |t|
32
- t.libs << 'lib'
33
- t.libs << 'test'
34
- t.pattern = 'test/**/*_test.rb'
35
- t.verbose = false
40
+ rdoc.rdoc_dir = 'rdoc'
41
+ rdoc.title = "inbox #{version}"
42
+ rdoc.rdoc_files.include('README*')
43
+ rdoc.rdoc_files.include('lib/**/*.rb')
36
44
  end
37
-
38
-
39
- task :default => :test
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.0
@@ -0,0 +1,16 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
data/example/Gemfile ADDED
@@ -0,0 +1,39 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.1.4'
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+ # Use SCSS for stylesheets
9
+ gem 'sass-rails', '~> 4.0.3'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
12
+ # Use CoffeeScript for .js.coffee assets and views
13
+ gem 'coffee-rails', '~> 4.0.0'
14
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
15
+ # gem 'therubyracer', platforms: :ruby
16
+
17
+ # Use jquery as the JavaScript library
18
+ gem 'jquery-rails'
19
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
+ gem 'turbolinks'
21
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
25
+
26
+ gem 'inbox', :path => '../../'
27
+
28
+ # Use ActiveModel has_secure_password
29
+ # gem 'bcrypt', '~> 3.1.7'
30
+
31
+ # Use unicorn as the app server
32
+ # gem 'unicorn'
33
+
34
+ # Use Capistrano for deployment
35
+ # gem 'capistrano-rails', group: :development
36
+
37
+ # Use debugger
38
+ # gem 'debugger', group: [:development, :test]
39
+