haraway 0.1.0.dev.46 → 0.1.0.dev.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/haraway/active_record/asset.rb +11 -0
- data/lib/haraway/active_record/macro.rb +8 -1
- data/lib/haraway/config.rb +1 -4
- data/lib/haraway/deleter.rb +3 -2
- data/lib/haraway/lib_version.rb +1 -1
- data/lib/haraway/profile.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5c551d80699f6209c2e7ec9e66e02c04eccb5a0
|
4
|
+
data.tar.gz: 3c756a320f549230206f99f9d791416f43b97286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be6b6917602ab8d490e9615e7092249b38a95cbf9dbf2a1915cc363deed57d460c1f8f6eedf7434200a76f9b2bda94d1440f39b211c8506074d043608585114
|
7
|
+
data.tar.gz: a29cf0aee875795c7403fe32a79b5e87589de6ab50d0eff9043360d0ac66a9198a6b666261b27bbde2ae7094e71a867a6a7b9f35b1d1040e626d2404c00b900d
|
@@ -13,6 +13,10 @@ class Haraway::ActiveRecord::Asset
|
|
13
13
|
!!@_destroy
|
14
14
|
end
|
15
15
|
|
16
|
+
def destroy!
|
17
|
+
@_destroy = true
|
18
|
+
end
|
19
|
+
|
16
20
|
def url(version=nil)
|
17
21
|
if version.nil?
|
18
22
|
self.url("original")
|
@@ -29,6 +33,13 @@ class Haraway::ActiveRecord::Asset
|
|
29
33
|
@attributes = attributes.except(:id, :_destroy)
|
30
34
|
end
|
31
35
|
|
36
|
+
def attributes
|
37
|
+
attributes = @attributes.dup
|
38
|
+
attributes[:id] = @id
|
39
|
+
attributes[:_destroy] = true if @_destroy
|
40
|
+
attributes.with_indifferent_access
|
41
|
+
end
|
42
|
+
|
32
43
|
def method_missing(m, *a, &b)
|
33
44
|
case m.to_s
|
34
45
|
|
@@ -106,7 +106,14 @@ private
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def #{name}=(value)
|
109
|
-
|
109
|
+
values = [value]
|
110
|
+
|
111
|
+
haraway_read_assets(#{name.inspect}).each do |old_asset|
|
112
|
+
old_asset.destroy!
|
113
|
+
values.push(old_asset.attributes)
|
114
|
+
end
|
115
|
+
|
116
|
+
haraway_write_assets(#{name.inspect}, values)
|
110
117
|
end
|
111
118
|
|
112
119
|
self
|
data/lib/haraway/config.rb
CHANGED
@@ -37,11 +37,8 @@ class Haraway::Config
|
|
37
37
|
@config.secret_key = v
|
38
38
|
end
|
39
39
|
|
40
|
-
def pusher_key=(v)
|
41
|
-
@config.pusher_key = v
|
42
|
-
end
|
43
|
-
|
44
40
|
def profile(name, &block)
|
41
|
+
name = name.to_s
|
45
42
|
profile = Haraway::Profile.new(name, &block)
|
46
43
|
@config.profiles[name] = profile
|
47
44
|
end
|
data/lib/haraway/deleter.rb
CHANGED
@@ -13,9 +13,10 @@ class Haraway::Deleter
|
|
13
13
|
token = creds.make_authentication_message("manager")
|
14
14
|
|
15
15
|
Net::HTTP.start("api."+@config.endpoint, :use_ssl => @config.use_ssl) do |http|
|
16
|
-
req = Net::HTTP::Post.new("/
|
16
|
+
req = Net::HTTP::Post.new("/delete")
|
17
17
|
req["Content-Type"] = "text/json; charset=utf-8"
|
18
|
-
req
|
18
|
+
req["Authorization"] = "haraway-token #{token}"
|
19
|
+
req.body = JSON.dump({ :asset_ids => @assets })
|
19
20
|
|
20
21
|
resp = http.request(req)
|
21
22
|
if resp.code != "200"
|
data/lib/haraway/lib_version.rb
CHANGED
data/lib/haraway/profile.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haraway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.dev.
|
4
|
+
version: 0.1.0.dev.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Menke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|