iftttify 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/iftttify/iftttify.rb +10 -12
  3. data/lib/iftttify/version.rb +1 -1
  4. data/test/dummy/log/test.log +9 -5354
  5. metadata +31 -71
  6. data/lib/iftttify/exceptions.rb~ +0 -3
  7. data/lib/iftttify/iftttify-test.rb~ +0 -2
  8. data/lib/iftttify/iftttify.rb~ +0 -3
  9. data/lib/iftttify.rb~ +0 -2
  10. data/test/dummy/app/controllers/pages_controller.rb~ +0 -10
  11. data/test/dummy/app/controllers/pages_controller_controller.rb~ +0 -4
  12. data/test/dummy/config/routes.rb~ +0 -58
  13. data/test/dummy/log/development.log +0 -0
  14. data/test/dummy/test/controllers/pages_controller_controller_test.rb~ +0 -9
  15. data/test/dummy/test/controllers/pages_controller_test.rb~ +0 -154
  16. data/test/dummy/test/helpers/pages_controller_helper_test.rb~ +0 -4
  17. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  18. data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  19. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  20. data/test/dummy/tmp/cache/assets/test/sprockets/8b52dc7bef008d7a85d9ce52db12fe8c +0 -0
  21. data/test/dummy/tmp/cache/assets/test/sprockets/901165c6156d9179acf3af06ca62130a +0 -0
  22. data/test/dummy/tmp/cache/assets/test/sprockets/bd1089d505cf5d172d83615cc4a8bdcb +0 -0
  23. data/test/dummy/tmp/cache/assets/test/sprockets/be08755da3d40b9f93e34e65c8c4176d +0 -0
  24. data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  25. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  26. data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  27. data/test/iftttify_test.rb~ +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 811d0030df17e2625eb2648e3f078033b542af5d
4
- data.tar.gz: e617d601f3b31ee28f956d899c66a2a7f69cab12
3
+ metadata.gz: 705d634de12935de87953e3691fbaf08a81bfb7e
4
+ data.tar.gz: b4d6312d87a02600aae00c5b912b6e96ff30afa2
5
5
  SHA512:
6
- metadata.gz: 6a06ab622f9ab17df267f2361fe13f20118b784e857ddea9ccaa9fc89fd132bf435cce68d95c198e93b89328d48e62635fbeddd17bb42ee0c897eb477d8bc808
7
- data.tar.gz: 1e56d066f2a8aa9142ed5f0819a9c36baf2e298fc8495229e29ad974e3cf9668755a32fda000d89ef101332f49e948e330884ab7fe04343c2fb547aecbf0891a
6
+ metadata.gz: 5d0c01789fb332decee0b4fb966000ee333b253eb43ea08c24a19e9bac17a98bfeb35b32b805a8765770cb264f3f579acbfa4741945b47708a74062b9be1b0b5
7
+ data.tar.gz: d175b36f5c88df94486d8d33c9dcf77c69e64192c8aa65731a95ed1c56d553a1af03a0517fca8ee95e8aae1ce88999aede5880da380d4c4c9e477628e7df2b4f
@@ -1,10 +1,9 @@
1
1
  require 'ostruct'
2
2
 
3
3
  module Iftttify
4
- Post = Struct.new :blog_name, :username, :password, :title, :body
5
-
6
- def self.process(request, options, &block)
7
-
4
+ def self.process(request, options)
5
+ post = Struct.new :blog_name, :username, :password, :title, :body
6
+
8
7
  r = Hash.from_xml(request.body.read)
9
8
 
10
9
  methodName = r["methodCall"]["methodName"]
@@ -18,14 +17,13 @@ module Iftttify
18
17
  password = r["methodCall"]["params"]["param"][2]["value"]["string"]
19
18
  if !options[:auth] || (options[:auth][:username] == username) && (options[:auth][:password] == password)
20
19
  h = Iftttify::members_to_hash(r["methodCall"]["params"]["param"][3]["value"]["struct"]["member"])
21
- result = block.call Post.new(
22
- r["methodCall"]["params"]["param"][0]["value"]["string"],
23
- username,
24
- password,
25
- h[:title],
26
- h[:description]
27
- )
28
- result
20
+ yield post.new(
21
+ r["methodCall"]["params"]["param"][0]["value"]["string"],
22
+ username,
23
+ password,
24
+ h[:title],
25
+ h[:description]
26
+ )
29
27
  else
30
28
  raise Iftttify::Exceptions::InvalidCredential, "Failed to verify credential provided: [#{username}] with [#{password}]"
31
29
  end
@@ -1,3 +1,3 @@
1
1
  module Iftttify
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end