pebble_timeline 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/pebble_timeline/api.rb +4 -1
- data/lib/pebble_timeline/representer/action.rb +1 -0
- data/lib/pebble_timeline/representer/layout.rb +23 -0
- data/lib/pebble_timeline/subscriptions.rb +11 -0
- data/lib/pebble_timeline/version.rb +1 -1
- data/lib/pebble_timeline.rb +1 -0
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b9f963dfdcfe444374718db5508c0642afb794d0
         | 
| 4 | 
            +
              data.tar.gz: 7f4201115b6e339698823d7c880edc55c2ac6154
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 8466a192ee66f3b3cb3dc90b101fd97742bc15d0ddaeb61a902fa7fe12ccbef495a047958803aadafaac2843c44c51df71dc2e9789d02f3757a48e1e61665eeb
         | 
| 7 | 
            +
              data.tar.gz: eda34eb53e0dd988fddd88dc6a1df9b7b6082c06bd581a8247e0e2e1779310f2da10459a1d0150928d034302a8ec218157ec5486da38f7efa3ed03244fa4f0cf
         | 
    
        data/README.md
    CHANGED
    
    | @@ -23,17 +23,22 @@ Or install it yourself as: | |
| 23 23 | 
             
            ```
         | 
| 24 24 | 
             
            require 'pebble_timeline'
         | 
| 25 25 |  | 
| 26 | 
            -
            api = PebbleTimeline::API.new( | 
| 26 | 
            +
            api = PebbleTimeline::API.new(API_KEY)
         | 
| 27 27 |  | 
| 28 28 | 
             
            # Shared pins
         | 
| 29 29 | 
             
            pins = PebbleTimeline::Pins.new(api)
         | 
| 30 | 
            -
            pins.create(id: "test-1", topics: 'test', time: "2015-06- | 
| 30 | 
            +
            pins.create(id: "test-1", topics: 'test', time: "2015-06-19T20:00:00Z", layout: { type: 'genericPin', title: 'test 1' })
         | 
| 31 | 
            +
            pins.update("test-1", topics: 'test', time: "2015-06-19T20:00:00Z", layout: { type: 'genericPin', title: 'test 1' })
         | 
| 31 32 | 
             
            pins.delete("test-1")
         | 
| 32 33 |  | 
| 33 34 | 
             
            # User pins
         | 
| 34 35 | 
             
            user_pins = PebbleTimeline::Pins.new(api, 'user', USER_TOKEN)
         | 
| 35 36 | 
             
            user_pins.create(id: "test-1", time: "2015-06-12T16:42:00Z", layout: { type: 'genericPin', title: 'test 1' })
         | 
| 36 37 | 
             
            user_pins.delete("test-1")
         | 
| 38 | 
            +
             | 
| 39 | 
            +
            # Subscriptions
         | 
| 40 | 
            +
            subscriptions = PebbleTimeline::Subscriptions.new(api)
         | 
| 41 | 
            +
            subscriptions.get(USER_TOKEN)
         | 
| 37 42 | 
             
            ```
         | 
| 38 43 |  | 
| 39 44 | 
             
            ## Contributing
         | 
    
        data/lib/pebble_timeline/api.rb
    CHANGED
    
    | @@ -42,7 +42,10 @@ module PebbleTimeline | |
| 42 42 | 
             
                  end
         | 
| 43 43 |  | 
| 44 44 | 
             
                  def get(path, params)
         | 
| 45 | 
            -
                    connection.get | 
| 45 | 
            +
                    connection.get do |req|
         | 
| 46 | 
            +
                      req.url resource_url(path)
         | 
| 47 | 
            +
                      req.headers['X-User-Token'] = params.delete(:user_token) if params.has_key? :user_token
         | 
| 48 | 
            +
                    end
         | 
| 46 49 | 
             
                  end
         | 
| 47 50 |  | 
| 48 51 | 
             
                  def delete(path, params)
         | 
| @@ -6,6 +6,7 @@ module PebbleTimeline | |
| 6 6 | 
             
                class LayoutRepresenter < Roar::Decorator
         | 
| 7 7 | 
             
                  include Roar::JSON
         | 
| 8 8 |  | 
| 9 | 
            +
                  # The type field is always required to determine the type of layout being displayed.
         | 
| 9 10 | 
             
                  property :type
         | 
| 10 11 | 
             
                  property :title
         | 
| 11 12 | 
             
                  property :shortTitle
         | 
| @@ -14,6 +15,28 @@ module PebbleTimeline | |
| 14 15 | 
             
                  property :tinyIcon
         | 
| 15 16 | 
             
                  property :smallIcon
         | 
| 16 17 | 
             
                  property :largeIcon
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  # The following attributes are also available for all pin layout types (excluding notifications and reminders).
         | 
| 20 | 
            +
                  property :primaryColor
         | 
| 21 | 
            +
                  property :secondaryColor
         | 
| 22 | 
            +
                  property :backgroundColor
         | 
| 23 | 
            +
                  property :headings
         | 
| 24 | 
            +
                  property :paragraphs
         | 
| 25 | 
            +
                  property :lastUpdated
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                  # Calendar Layout & Weather Layout & Generic Reminder
         | 
| 28 | 
            +
                  property :locationName
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                  # Sports Layout
         | 
| 31 | 
            +
                  property :rankAway
         | 
| 32 | 
            +
                  property :rankHome
         | 
| 33 | 
            +
                  property :nameAway
         | 
| 34 | 
            +
                  property :nameHome
         | 
| 35 | 
            +
                  property :recordAway
         | 
| 36 | 
            +
                  property :recordHome
         | 
| 37 | 
            +
                  property :scoreAway
         | 
| 38 | 
            +
                  property :scoreHome
         | 
| 39 | 
            +
                  property :sportsGameState
         | 
| 17 40 | 
             
                end
         | 
| 18 41 | 
             
              end
         | 
| 19 42 | 
             
            end
         | 
    
        data/lib/pebble_timeline.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: pebble_timeline
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Salim Hbeiliny
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2015-06- | 
| 11 | 
            +
            date: 2015-06-19 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         | 
| @@ -158,6 +158,7 @@ files: | |
| 158 158 | 
             
            - lib/pebble_timeline/representer/notification.rb
         | 
| 159 159 | 
             
            - lib/pebble_timeline/representer/pin.rb
         | 
| 160 160 | 
             
            - lib/pebble_timeline/representer/reminder.rb
         | 
| 161 | 
            +
            - lib/pebble_timeline/subscriptions.rb
         | 
| 161 162 | 
             
            - lib/pebble_timeline/version.rb
         | 
| 162 163 | 
             
            - pebble_timeline.gemspec
         | 
| 163 164 | 
             
            homepage: ''
         |