NeonRAW 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +5 -0
  5. data/.travis.yml +4 -0
  6. data/CHANGELOG.md +7 -0
  7. data/CONTRIBUTING.md +11 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE.md +373 -0
  10. data/NeonRAW.gemspec +26 -0
  11. data/README.md +62 -0
  12. data/Rakefile +6 -0
  13. data/bin/console +14 -0
  14. data/bin/setup +8 -0
  15. data/examples/crossposter.rb +78 -0
  16. data/examples/flairbot.rb +60 -0
  17. data/examples/publicmodlogger.rb +79 -0
  18. data/examples/settings.yaml +4 -0
  19. data/examples/userhistoryscraper.rb +108 -0
  20. data/examples/userhistorywiper.rb +10 -0
  21. data/lib/NeonRAW/clients/base/listing.rb +55 -0
  22. data/lib/NeonRAW/clients/base/objectbuilder.rb +173 -0
  23. data/lib/NeonRAW/clients/base/utilities.rb +46 -0
  24. data/lib/NeonRAW/clients/base.rb +109 -0
  25. data/lib/NeonRAW/clients/installed.rb +49 -0
  26. data/lib/NeonRAW/clients/script.rb +34 -0
  27. data/lib/NeonRAW/clients/web.rb +52 -0
  28. data/lib/NeonRAW/errors.rb +518 -0
  29. data/lib/NeonRAW/objects/access.rb +44 -0
  30. data/lib/NeonRAW/objects/all.rb +36 -0
  31. data/lib/NeonRAW/objects/comment.rb +128 -0
  32. data/lib/NeonRAW/objects/inboxcomment.rb +54 -0
  33. data/lib/NeonRAW/objects/listing.rb +12 -0
  34. data/lib/NeonRAW/objects/me.rb +268 -0
  35. data/lib/NeonRAW/objects/modlogaction.rb +59 -0
  36. data/lib/NeonRAW/objects/modloguser.rb +35 -0
  37. data/lib/NeonRAW/objects/morecomments.rb +33 -0
  38. data/lib/NeonRAW/objects/multireddit.rb +134 -0
  39. data/lib/NeonRAW/objects/privatemessage.rb +90 -0
  40. data/lib/NeonRAW/objects/rule.rb +41 -0
  41. data/lib/NeonRAW/objects/submission.rb +221 -0
  42. data/lib/NeonRAW/objects/subreddit/flair.rb +169 -0
  43. data/lib/NeonRAW/objects/subreddit/moderation.rb +200 -0
  44. data/lib/NeonRAW/objects/subreddit/utilities.rb +73 -0
  45. data/lib/NeonRAW/objects/subreddit/wiki.rb +31 -0
  46. data/lib/NeonRAW/objects/subreddit.rb +223 -0
  47. data/lib/NeonRAW/objects/thing/createable.rb +22 -0
  48. data/lib/NeonRAW/objects/thing/editable.rb +46 -0
  49. data/lib/NeonRAW/objects/thing/gildable.rb +29 -0
  50. data/lib/NeonRAW/objects/thing/inboxable.rb +26 -0
  51. data/lib/NeonRAW/objects/thing/moderateable.rb +98 -0
  52. data/lib/NeonRAW/objects/thing/refreshable.rb +21 -0
  53. data/lib/NeonRAW/objects/thing/repliable.rb +23 -0
  54. data/lib/NeonRAW/objects/thing/saveable.rb +26 -0
  55. data/lib/NeonRAW/objects/thing/votable.rb +69 -0
  56. data/lib/NeonRAW/objects/thing.rb +24 -0
  57. data/lib/NeonRAW/objects/trophy.rb +25 -0
  58. data/lib/NeonRAW/objects/user.rb +147 -0
  59. data/lib/NeonRAW/objects/wikipage.rb +176 -0
  60. data/lib/NeonRAW/objects/wikipagerevision.rb +45 -0
  61. data/lib/NeonRAW/version.rb +3 -0
  62. data/lib/NeonRAW.rb +43 -0
  63. metadata +161 -0
data/lib/NeonRAW.rb ADDED
@@ -0,0 +1,43 @@
1
+ # rubocop:disable Style/FileName
2
+ require 'NeonRAW/version'
3
+ require 'NeonRAW/clients/installed'
4
+ require 'NeonRAW/clients/script'
5
+ require 'NeonRAW/clients/web'
6
+
7
+ # The main module.
8
+ module NeonRAW
9
+ # Creates the Installed client.
10
+ # @param client_id [String] The client_id of the app.
11
+ # @param redirect_uri [String] The redirect_uri of the app.
12
+ # @param opts [Hash] Optional parameters.
13
+ # @option opts :user_agent [String] The user_agent of the app.
14
+ # @return [NeonRAW::Clients::Installed] Returns the Installed client.
15
+ def self.installed(client_id, redirect_uri, opts = {})
16
+ Clients::Installed.new(client_id, redirect_uri, opts)
17
+ end
18
+
19
+ # Creates the Script client.
20
+ # @param username [String] The username of the user.
21
+ # @param password [String] The password of the user.
22
+ # @param client_id [String] The client_id of the app.
23
+ # @param secret [String] The secret of the app.
24
+ # @param opts [Hash] Optional parameters.
25
+ # @option opts :user_agent [String] The user_agent of the app.
26
+ # @option opts :redirect_uri [String] The redirect_uri (defaults to
27
+ # http://127.0.0.1:).
28
+ # @return [NeonRAW::Clients::Script] Returns the Script client.
29
+ def self.script(username, password, client_id, secret, opts = {})
30
+ Clients::Script.new(username, password, client_id, secret, opts)
31
+ end
32
+
33
+ # Creates the Web client.
34
+ # @param client_id [String] The client_id of the app.
35
+ # @param secret [String] The secret of the app.
36
+ # @param redirect_uri [String] The redirect_uri of the app.
37
+ # @param opts [Hash] Optional parameters.
38
+ # @option opts :user_agent [String] The user_agent of the app.
39
+ # @return [NeonRAW::Clients::Web] Returns the Web client.
40
+ def self.web(client_id, secret, redirect_uri, opts = {})
41
+ Clients::Web.new(client_id, secret, redirect_uri, opts)
42
+ end
43
+ end
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: NeonRAW
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - SirNeon
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-04-23 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.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: typhoeus
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.7'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.7'
69
+ description: SirNeon's wonderful API wrapper for Reddit.
70
+ email:
71
+ - sirneon618@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".rubocop.yml"
79
+ - ".travis.yml"
80
+ - CHANGELOG.md
81
+ - CONTRIBUTING.md
82
+ - Gemfile
83
+ - LICENSE.md
84
+ - NeonRAW.gemspec
85
+ - README.md
86
+ - Rakefile
87
+ - bin/console
88
+ - bin/setup
89
+ - examples/crossposter.rb
90
+ - examples/flairbot.rb
91
+ - examples/publicmodlogger.rb
92
+ - examples/settings.yaml
93
+ - examples/userhistoryscraper.rb
94
+ - examples/userhistorywiper.rb
95
+ - lib/NeonRAW.rb
96
+ - lib/NeonRAW/clients/base.rb
97
+ - lib/NeonRAW/clients/base/listing.rb
98
+ - lib/NeonRAW/clients/base/objectbuilder.rb
99
+ - lib/NeonRAW/clients/base/utilities.rb
100
+ - lib/NeonRAW/clients/installed.rb
101
+ - lib/NeonRAW/clients/script.rb
102
+ - lib/NeonRAW/clients/web.rb
103
+ - lib/NeonRAW/errors.rb
104
+ - lib/NeonRAW/objects/access.rb
105
+ - lib/NeonRAW/objects/all.rb
106
+ - lib/NeonRAW/objects/comment.rb
107
+ - lib/NeonRAW/objects/inboxcomment.rb
108
+ - lib/NeonRAW/objects/listing.rb
109
+ - lib/NeonRAW/objects/me.rb
110
+ - lib/NeonRAW/objects/modlogaction.rb
111
+ - lib/NeonRAW/objects/modloguser.rb
112
+ - lib/NeonRAW/objects/morecomments.rb
113
+ - lib/NeonRAW/objects/multireddit.rb
114
+ - lib/NeonRAW/objects/privatemessage.rb
115
+ - lib/NeonRAW/objects/rule.rb
116
+ - lib/NeonRAW/objects/submission.rb
117
+ - lib/NeonRAW/objects/subreddit.rb
118
+ - lib/NeonRAW/objects/subreddit/flair.rb
119
+ - lib/NeonRAW/objects/subreddit/moderation.rb
120
+ - lib/NeonRAW/objects/subreddit/utilities.rb
121
+ - lib/NeonRAW/objects/subreddit/wiki.rb
122
+ - lib/NeonRAW/objects/thing.rb
123
+ - lib/NeonRAW/objects/thing/createable.rb
124
+ - lib/NeonRAW/objects/thing/editable.rb
125
+ - lib/NeonRAW/objects/thing/gildable.rb
126
+ - lib/NeonRAW/objects/thing/inboxable.rb
127
+ - lib/NeonRAW/objects/thing/moderateable.rb
128
+ - lib/NeonRAW/objects/thing/refreshable.rb
129
+ - lib/NeonRAW/objects/thing/repliable.rb
130
+ - lib/NeonRAW/objects/thing/saveable.rb
131
+ - lib/NeonRAW/objects/thing/votable.rb
132
+ - lib/NeonRAW/objects/trophy.rb
133
+ - lib/NeonRAW/objects/user.rb
134
+ - lib/NeonRAW/objects/wikipage.rb
135
+ - lib/NeonRAW/objects/wikipagerevision.rb
136
+ - lib/NeonRAW/version.rb
137
+ homepage: https://gitlab.com/SirNeon/NeonRAW
138
+ licenses:
139
+ - MPL-2.0
140
+ metadata: {}
141
+ post_install_message:
142
+ rdoc_options: []
143
+ require_paths:
144
+ - lib
145
+ required_ruby_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: 2.1.0
150
+ required_rubygems_version: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ requirements: []
156
+ rubyforge_project:
157
+ rubygems_version: 2.5.1
158
+ signing_key:
159
+ specification_version: 4
160
+ summary: A Reddit API wrapper for Ruby.
161
+ test_files: []