inbox 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/README.md +38 -34
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/inbox.gemspec +7 -196
- data/lib/calendar.rb +16 -0
- data/lib/draft.rb +2 -2
- data/lib/event.rb +14 -0
- data/lib/file.rb +1 -1
- data/lib/inbox.rb +10 -10
- data/lib/message.rb +2 -9
- data/lib/restful_model.rb +4 -4
- data/lib/restful_model_collection.rb +7 -6
- data/lib/thread.rb +2 -8
- data/spec/inbox_spec.rb +3 -3
- data/spec/restful_model_spec.rb +3 -2
- metadata +6 -668
- data/example/Gemfile +0 -39
- data/example/README.rdoc +0 -28
- data/example/Rakefile +0 -6
- data/example/app/assets/images/.keep +0 -0
- data/example/app/assets/javascripts/application.js +0 -16
- data/example/app/assets/javascripts/welcome.js.coffee +0 -3
- data/example/app/assets/stylesheets/application.css +0 -15
- data/example/app/assets/stylesheets/welcome.css.scss +0 -3
- data/example/app/controllers/application_controller.rb +0 -61
- data/example/app/controllers/concerns/.keep +0 -0
- data/example/app/helpers/application_helper.rb +0 -2
- data/example/app/helpers/welcome_helper.rb +0 -2
- data/example/app/mailers/.keep +0 -0
- data/example/app/models/.keep +0 -0
- data/example/app/models/concerns/.keep +0 -0
- data/example/app/views/layouts/application.html.erb +0 -14
- data/example/app/views/welcome/index.html.erb +0 -2
- data/example/bin/bundle +0 -3
- data/example/bin/rails +0 -8
- data/example/bin/rake +0 -8
- data/example/bin/spring +0 -18
- data/example/config/application.rb +0 -23
- data/example/config/boot.rb +0 -4
- data/example/config/database.yml +0 -25
- data/example/config/environment.rb +0 -5
- data/example/config/environments/development.rb +0 -39
- data/example/config/environments/production.rb +0 -82
- data/example/config/environments/test.rb +0 -41
- data/example/config/initializers/assets.rb +0 -8
- data/example/config/initializers/backtrace_silencers.rb +0 -7
- data/example/config/initializers/cookies_serializer.rb +0 -3
- data/example/config/initializers/filter_parameter_logging.rb +0 -4
- data/example/config/initializers/inflections.rb +0 -16
- data/example/config/initializers/mime_types.rb +0 -4
- data/example/config/initializers/session_store.rb +0 -3
- data/example/config/initializers/wrap_parameters.rb +0 -14
- data/example/config/locales/en.yml +0 -23
- data/example/config/routes.rb +0 -59
- data/example/config/secrets.yml +0 -22
- data/example/config.ru +0 -4
- data/example/db/seeds.rb +0 -7
- data/example/lib/assets/.keep +0 -0
- data/example/lib/tasks/.keep +0 -0
- data/example/log/.keep +0 -0
- data/example/public/404.html +0 -67
- data/example/public/422.html +0 -67
- data/example/public/500.html +0 -66
- data/example/public/favicon.ico +0 -0
- data/example/public/robots.txt +0 -5
- data/example/test/controllers/.keep +0 -0
- data/example/test/controllers/welcome_controller_test.rb +0 -9
- data/example/test/fixtures/.keep +0 -0
- data/example/test/fixtures/users.yml +0 -11
- data/example/test/helpers/.keep +0 -0
- data/example/test/helpers/welcome_helper_test.rb +0 -4
- data/example/test/integration/.keep +0 -0
- data/example/test/mailers/.keep +0 -0
- data/example/test/models/.keep +0 -0
- data/example/test/models/user_test.rb +0 -7
- data/example/test/test_helper.rb +0 -10
- data/example/vendor/assets/javascripts/.keep +0 -0
- data/example/vendor/assets/stylesheets/.keep +0 -0
data/lib/thread.rb
CHANGED
@@ -12,18 +12,12 @@ module Inbox
|
|
12
12
|
attr_accessor :message_ids
|
13
13
|
attr_accessor :draft_ids
|
14
14
|
|
15
|
-
def inflate(json)
|
16
|
-
super
|
17
|
-
message_ids = json[:messages]
|
18
|
-
draft_ids = json[:drafts]
|
19
|
-
end
|
20
|
-
|
21
15
|
def messages
|
22
|
-
@messages ||= RestfulModelCollection.new(Message, @_api, @
|
16
|
+
@messages ||= RestfulModelCollection.new(Message, @_api, @namespace_id, {:thread_id=>@id})
|
23
17
|
end
|
24
18
|
|
25
19
|
def drafts
|
26
|
-
@drafts ||= RestfulModelCollection.new(Draft, @_api, @
|
20
|
+
@drafts ||= RestfulModelCollection.new(Draft, @_api, @namespace_id, {:thread_id=>@id})
|
27
21
|
end
|
28
22
|
|
29
23
|
def update_tags!(tags_to_add = [], tags_to_remove = [])
|
data/spec/inbox_spec.rb
CHANGED
@@ -5,13 +5,13 @@ describe 'Inbox' do
|
|
5
5
|
before (:each) do
|
6
6
|
@app_id = 'ABC'
|
7
7
|
@app_secret = '123'
|
8
|
-
@
|
9
|
-
@inbox = Inbox::API.new(@app_id, @app_secret, @
|
8
|
+
@access_token = 'UXXMOCJW-BKSLPCFI-UQAQFWLO'
|
9
|
+
@inbox = Inbox::API.new(@app_id, @app_secret, @access_token)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe "#url_for_path" do
|
13
13
|
it "should return the url for a provided path" do
|
14
|
-
expect(@inbox.url_for_path('/wobble')).to eq("https://#{@inbox.
|
14
|
+
expect(@inbox.url_for_path('/wobble')).to eq("https://#{@inbox.access_token}:@api.inboxapp.com/wobble")
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return an error if you have not provided an auth token" do
|
data/spec/restful_model_spec.rb
CHANGED
@@ -9,9 +9,10 @@ describe 'RestfulModel' do
|
|
9
9
|
describe "#as_json" do
|
10
10
|
it "should return a hash with the attr_accessor properties" do
|
11
11
|
r = Inbox::RestfulModel.new(@api)
|
12
|
-
r.
|
12
|
+
r.id = '1'
|
13
|
+
r.namespace_id = '123';
|
13
14
|
r.created_at = Time.new
|
14
|
-
expect(r.as_json).to eq({"
|
15
|
+
expect(r.as_json).to eq({"id" => "1", "namespace_id" => "123", "created_at" => r.created_at})
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|