front_end_builds 0.0.10 → 0.0.11

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
  SHA1:
3
- metadata.gz: 5b0bae26a8a3167cb25e22b876cd2546e0571f52
4
- data.tar.gz: 16753067d3568ccca71c40b62dc16742a8f1c64c
3
+ metadata.gz: 2a4d2e6eac89811c5e5781df016a660143303506
4
+ data.tar.gz: b69d465aa8f33ca73d5b5fc217b380536adcd300
5
5
  SHA512:
6
- metadata.gz: 5e192168590e288c913cad8318d44f6c719b9d5079247e813bc2979dc1bf09bf3a301905adc66f3cb9e1f4f2b804bcc42685b8761e0e7b8ed457ddb64eea2f46
7
- data.tar.gz: a7a0693b953ff9784f3a34f314d0f220e16cf4d1ac871566f8beda99e5d3f7e5a2673d8c4d83ea8dba3968ced00a43a63eaddaf5ea17227e8f3d46430891a3c5
6
+ metadata.gz: 4d7c27fa0ac6631d240589b8aa4acf42f9b046150865fd9b0ab498b1fecd025f69cc8a04683de26215aa6443bc767cbca59b3000a9408a1ce8dcf3bbefb0a19a
7
+ data.tar.gz: c1f30ca9fcbec3f8b04f80795a3a7623f938ec56d6d3e4b779633161a5b930c08d5b7b89a4799d3962732d718d277bb66b3b2ccf7ccafec0014d87686e987631
@@ -1,5 +1,9 @@
1
1
  module FrontEndBuilds
2
2
  class App < ActiveRecord::Base
3
+ if defined?(ProtectedAttributes) || ::ActiveRecord::VERSION::MAJOR < 4
4
+ attr_accessible :name
5
+ end
6
+
3
7
  has_many :builds, class_name: 'FrontEndBuilds::Build'
4
8
 
5
9
  validates :name, presence: true
@@ -1,8 +1,13 @@
1
- require 'net/http'
2
- require 'uri'
1
+ require 'open-uri'
3
2
 
4
3
  module FrontEndBuilds
5
4
  class Build < ActiveRecord::Base
5
+ if defined?(ProtectedAttributes) || ::ActiveRecord::VERSION::MAJOR < 4
6
+ attr_accessible :branch,
7
+ :sha,
8
+ :endpoint
9
+ end
10
+
6
11
  belongs_to :app, class_name: "FrontEndBuilds::App"
7
12
 
8
13
  validates :app, presence: true
@@ -58,16 +63,16 @@ module FrontEndBuilds
58
63
  def fetch!
59
64
  return if fetched?
60
65
 
61
- html = Net::HTTP.get(URI.parse(endpoint))
66
+ html = URI.parse(endpoint).read
62
67
 
63
- update_attributes(
64
- html: html,
65
- fetched: true
66
- )
68
+ self.html = html
69
+ self.fetched = true
70
+ save
67
71
  end
68
72
 
69
73
  def activate!
70
- update_attributes(active: true)
74
+ self.active = true
75
+ save
71
76
  end
72
77
 
73
78
  def with_head_tag(tag)
@@ -1,3 +1,3 @@
1
1
  module FrontEndBuilds
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: front_end_builds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Toronto
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-09 00:00:00.000000000 Z
12
+ date: 2015-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3