doattend 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8e0767758e057c37d911a25084c8cacf791e3f06
4
+ data.tar.gz: 1f77ce64670965484c8c4ac07b877ce7fe3b673e
5
+ SHA512:
6
+ metadata.gz: 374b2f6046d541be2bb164f5cb104a6533c76f28e856c250cff9ccb8b5a226b21c19965926519d3e9848a903d434f610efbc47c039372ece514ceb5e1e3cf3df
7
+ data.tar.gz: f51d38d5e281bdef4c0789b55996dd3deb3292ac945bbb6bc3fe0c49a50aab897b090f781deb559a6f512546c28f265b83f9461082a7f6156a8ab902bec698a5
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in doattend.gemspec
4
+ gemspec
5
+
6
+ gem "rest-client"
7
+ gem "yaml"
@@ -0,0 +1,29 @@
1
+ # DoAttend
2
+
3
+ Rails generator and functions to communicate the DoAttend API.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'doattend'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install doattend
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,11 @@
1
+ require "doattend/version"
2
+ require "doattend/base.rb"
3
+
4
+ module Doattend
5
+
6
+ # Fetch data from DoAttend API.
7
+ def self.fetch
8
+ Doattend::Base.fetch
9
+ end
10
+
11
+ end
@@ -0,0 +1,19 @@
1
+ require "rest-client"
2
+
3
+ module Doattend
4
+
5
+ class Base
6
+
7
+ def self.fetch
8
+ conf = YAML.load_file("#{Rails.root}/config/doattend.yml")
9
+ url = "http://doattend.com/api/events/#{conf['doattend']['event']}/participants_list.json?api_key=#{conf['doattend']['key']}"
10
+ begin
11
+ RestClient.get(url)
12
+ rescue Exception => e
13
+ e
14
+ end
15
+ end
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,3 @@
1
+ module Doattend
2
+ VERSION = "0.0.3"
3
+ end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Generates a config file called doattend.yml
3
+
4
+ Example:
5
+ rails generate doattend:install -e DOATTEND_EVENT_ID -k DOATTEND_API_KEY
6
+
7
+ This will create:
8
+ config/doattend.yml
@@ -0,0 +1,15 @@
1
+ require 'rails/generators'
2
+
3
+ module Doattend
4
+ class InstallGenerator < Rails::Generators::Base
5
+ source_root File.expand_path('../templates', __FILE__)
6
+
7
+ class_option :e, :type => :string, :required => true, :desc => "Specify DoAttend Event ID", :banner => "YOUR_DOATTEND_EVENT_ID"
8
+ class_option :k, :type => :string, :required => true, :desc => "Specify DoAttend API key", :banner => "YOUR_DOATTEND_API_KEY"
9
+
10
+ def generate_config
11
+ template "doattend.erb", "#{Rails.root}/config/doattend.yml"
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ doattend:
2
+ event: <%= options[:e] %>
3
+ key: <%= options[:k] %>
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: doattend
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Swaroop SM
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.2.13
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.13
55
+ - !ruby/object:Gem::Dependency
56
+ name: rest-client
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Communicating with DoAttend API
70
+ email:
71
+ - swaroop.striker@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - README.md
77
+ - Gemfile
78
+ - Rakefile
79
+ - lib/doattend/version.rb
80
+ - lib/doattend/base.rb
81
+ - lib/generators/doattend/install/USAGE
82
+ - lib/generators/doattend/install/templates/doattend.erb
83
+ - lib/generators/doattend/install/install_generator.rb
84
+ - lib/doattend.rb
85
+ homepage: https://github.com/swaroopsm/doattend
86
+ licenses:
87
+ - MIT
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.0.7
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: This provides a rails generator and functions to communicate with the DoAttend
109
+ API.
110
+ test_files: []