twinkle 0.2.2 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5b5dff3d492b803241ceaec6bc2bc6077c6417a380e6e820404d40d55afa51d
4
- data.tar.gz: '0291795717e1e61e813d1fef69a5f59b4c4bbf62c57c5efae3ef0674a325d736'
3
+ metadata.gz: 32da1aaa5ba1a4e05ae713ad4b33c3368b645bc53ed35935cee31690b55cf835
4
+ data.tar.gz: a61d31742ec6fa2ad90d0ffedd7658a6ece32ad5cf9f72ae476de7696349e49e
5
5
  SHA512:
6
- metadata.gz: 1a17c906e4d0c6a24bc6c0788fb0add3b7f592574e23b94ea2be004444c2245017d2af875931ff4da86b00a025bb5966f900a586bcd4ad30e09e5f73f7079f07
7
- data.tar.gz: dd2b2eebaf6599917fb830739b8e67ff1990c8f2fe0cc7e5f194baec828334cab6eb67bc68a9f33c1ac6cb39cf299c8ed2158a5f8c98ccb6d192d6cf2c9eb1ae
6
+ metadata.gz: a56e825ff1fac2e3bc0764f119e8cebd375701983795cddd01c540876437356e0ce30ae6f0c7af46551bd42ac07ec03a1b276bbf73f314bd6f7c48e7b0a2b718
7
+ data.tar.gz: 2bdb1271955b1833ad5efb55c478cc74566b0b3841144046b57db22346c73ad09fba72e916065cb921da65152dbc34e87ac5fa562b2fe5c1470a492077bd4714
@@ -1,7 +1,10 @@
1
1
  module Twinkle
2
2
  class AppcastController < ApplicationController
3
3
  def show
4
- @app = App.includes(:versions).where(versions: { published: true }).find_by!(slug: params[:slug])
4
+ @app = App.includes(:versions)
5
+ .where(versions: { published: true })
6
+ .order('versions.build DESC')
7
+ .find_by!(slug: params[:slug])
5
8
  Event.create(app: @app, **event_params)
6
9
  render layout: false, formats: :xml
7
10
  end
@@ -18,7 +21,8 @@ module Twinkle
18
21
  :cpusubtype,
19
22
  :ramMB,
20
23
  :osVersion,
21
- :lang
24
+ :lang,
25
+ :model
22
26
  )
23
27
  end
24
28
  end
@@ -4,9 +4,10 @@ module Twinkle
4
4
 
5
5
  scope :created_between, -> (start_date, end_date) {where("created_at >= ? AND created_at <= ?", start_date, end_date )}
6
6
 
7
- alias_attribute :app_version, :version
7
+ alias_attribute :appVersion, :version
8
8
  alias_attribute :cpuFreqMHz, :cpu_freq_mhz
9
9
  alias_attribute :osVersion, :os_version
10
+ alias_attribute :ramMB, :ram_mb
10
11
 
11
12
  def self.fields
12
13
  attribute_names.select{ |name| !['id', 'twinkle_app_id', 'created_at', 'updated_at'].include?(name) }
@@ -9,7 +9,7 @@ module Twinkle
9
9
  scope :since, ->(date) { where('twinkle_summaries.start_date >= ?', date).order('twinkle_summaries.start_date asc') }
10
10
  scope :week_of, -> (start_date, end_date) { where(period: :week).where("start_date >= ? AND end_date <= ?", start_date, end_date) }
11
11
 
12
- enum period: { week: 0, fortnight: 1, month: 2 }
12
+ enum :period, { week: 0, fortnight: 1, month: 2 }
13
13
 
14
14
  def hash_datapoints
15
15
  data = Event.fields.map { |name| [name, {}] }.append(['users', {}]).to_h
@@ -1,3 +1,3 @@
1
1
  module Twinkle
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twinkle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Marks
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.5.9
90
+ rubygems_version: 3.5.22
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Twinkle is a Rails engine for hosting appcast and collecting anonymous sparkle-project