octocore-mongo 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES.md +12 -0
  3. data/CONTRIBUTING +0 -0
  4. data/Gemfile +11 -0
  5. data/Gemfile.lock +150 -0
  6. data/LICENSE +202 -0
  7. data/MAINTAINERS +0 -0
  8. data/NOTICE +8 -0
  9. data/README.md +69 -0
  10. data/Rakefile +51 -0
  11. data/bin/fakestream-mongo +258 -0
  12. data/bin/octocore-admin-mongo +54 -0
  13. data/lib/octocore-mongo.rb +157 -0
  14. data/lib/octocore-mongo/baseline.rb +131 -0
  15. data/lib/octocore-mongo/callbacks.rb +117 -0
  16. data/lib/octocore-mongo/config.rb +39 -0
  17. data/lib/octocore-mongo/config/config.yml +1 -0
  18. data/lib/octocore-mongo/config/search/index/user.yml +42 -0
  19. data/lib/octocore-mongo/counter.rb +265 -0
  20. data/lib/octocore-mongo/counter/helpers.rb +168 -0
  21. data/lib/octocore-mongo/email.rb +63 -0
  22. data/lib/octocore-mongo/featureflag.rb +79 -0
  23. data/lib/octocore-mongo/helpers.rb +6 -0
  24. data/lib/octocore-mongo/helpers/api_consumer_helper.rb +51 -0
  25. data/lib/octocore-mongo/helpers/api_helper.rb +65 -0
  26. data/lib/octocore-mongo/helpers/api_logger.rb +14 -0
  27. data/lib/octocore-mongo/helpers/client_helper.rb +104 -0
  28. data/lib/octocore-mongo/helpers/kong_helper.rb +164 -0
  29. data/lib/octocore-mongo/helpers/sinatra_helper.rb +22 -0
  30. data/lib/octocore-mongo/kafka_bridge.rb +60 -0
  31. data/lib/octocore-mongo/kldivergence.rb +14 -0
  32. data/lib/octocore-mongo/mailer.rb +1 -0
  33. data/lib/octocore-mongo/mailer/subscriber_mailer.rb +32 -0
  34. data/lib/octocore-mongo/message_parser.rb +114 -0
  35. data/lib/octocore-mongo/models.rb +275 -0
  36. data/lib/octocore-mongo/models/contactus.rb +42 -0
  37. data/lib/octocore-mongo/models/enterprise.rb +75 -0
  38. data/lib/octocore-mongo/models/enterprise/adapter_details.rb +18 -0
  39. data/lib/octocore-mongo/models/enterprise/api_event.rb +14 -0
  40. data/lib/octocore-mongo/models/enterprise/api_hit.rb +20 -0
  41. data/lib/octocore-mongo/models/enterprise/api_key.rb +11 -0
  42. data/lib/octocore-mongo/models/enterprise/api_track.rb +13 -0
  43. data/lib/octocore-mongo/models/enterprise/app_init.rb +13 -0
  44. data/lib/octocore-mongo/models/enterprise/app_login.rb +12 -0
  45. data/lib/octocore-mongo/models/enterprise/app_logout.rb +12 -0
  46. data/lib/octocore-mongo/models/enterprise/authorization.rb +67 -0
  47. data/lib/octocore-mongo/models/enterprise/category.rb +14 -0
  48. data/lib/octocore-mongo/models/enterprise/category_baseline.rb +19 -0
  49. data/lib/octocore-mongo/models/enterprise/category_hit.rb +26 -0
  50. data/lib/octocore-mongo/models/enterprise/category_trend.rb +19 -0
  51. data/lib/octocore-mongo/models/enterprise/conversions.rb +69 -0
  52. data/lib/octocore-mongo/models/enterprise/ctr.rb +54 -0
  53. data/lib/octocore-mongo/models/enterprise/dimension_choice.rb +21 -0
  54. data/lib/octocore-mongo/models/enterprise/engagement_time.rb +43 -0
  55. data/lib/octocore-mongo/models/enterprise/funnel_data.rb +20 -0
  56. data/lib/octocore-mongo/models/enterprise/funnel_tracker.rb +19 -0
  57. data/lib/octocore-mongo/models/enterprise/funnels.rb +129 -0
  58. data/lib/octocore-mongo/models/enterprise/gcm.rb +21 -0
  59. data/lib/octocore-mongo/models/enterprise/newsfeed_hit.rb +52 -0
  60. data/lib/octocore-mongo/models/enterprise/notification_hit.rb +42 -0
  61. data/lib/octocore-mongo/models/enterprise/page.rb +15 -0
  62. data/lib/octocore-mongo/models/enterprise/page_view.rb +14 -0
  63. data/lib/octocore-mongo/models/enterprise/pageload_time.rb +43 -0
  64. data/lib/octocore-mongo/models/enterprise/product.rb +22 -0
  65. data/lib/octocore-mongo/models/enterprise/product_baseline.rb +20 -0
  66. data/lib/octocore-mongo/models/enterprise/product_hit.rb +26 -0
  67. data/lib/octocore-mongo/models/enterprise/product_page_view.rb +13 -0
  68. data/lib/octocore-mongo/models/enterprise/product_trend.rb +18 -0
  69. data/lib/octocore-mongo/models/enterprise/push_key.rb +15 -0
  70. data/lib/octocore-mongo/models/enterprise/rules.rb +45 -0
  71. data/lib/octocore-mongo/models/enterprise/segment.rb +65 -0
  72. data/lib/octocore-mongo/models/enterprise/segment_data.rb +22 -0
  73. data/lib/octocore-mongo/models/enterprise/tag.rb +14 -0
  74. data/lib/octocore-mongo/models/enterprise/tag_baseline.rb +19 -0
  75. data/lib/octocore-mongo/models/enterprise/tag_hit.rb +26 -0
  76. data/lib/octocore-mongo/models/enterprise/tag_trend.rb +19 -0
  77. data/lib/octocore-mongo/models/enterprise/template.rb +18 -0
  78. data/lib/octocore-mongo/models/plans.rb +17 -0
  79. data/lib/octocore-mongo/models/subscribe.rb +13 -0
  80. data/lib/octocore-mongo/models/user.rb +13 -0
  81. data/lib/octocore-mongo/models/user/push_token.rb +15 -0
  82. data/lib/octocore-mongo/models/user/user_browser_details.rb +16 -0
  83. data/lib/octocore-mongo/models/user/user_location_history.rb +15 -0
  84. data/lib/octocore-mongo/models/user/user_persona.rb +101 -0
  85. data/lib/octocore-mongo/models/user/user_phone_details.rb +17 -0
  86. data/lib/octocore-mongo/models/user/user_profile.rb +20 -0
  87. data/lib/octocore-mongo/models/user/user_timeline.rb +111 -0
  88. data/lib/octocore-mongo/record.rb +20 -0
  89. data/lib/octocore-mongo/schedeuleable.rb +20 -0
  90. data/lib/octocore-mongo/scheduler.rb +72 -0
  91. data/lib/octocore-mongo/search.rb +5 -0
  92. data/lib/octocore-mongo/search/client.rb +33 -0
  93. data/lib/octocore-mongo/search/indexer.rb +0 -0
  94. data/lib/octocore-mongo/search/searchable.rb +18 -0
  95. data/lib/octocore-mongo/search/setup.rb +71 -0
  96. data/lib/octocore-mongo/segment.rb +287 -0
  97. data/lib/octocore-mongo/stats.rb +33 -0
  98. data/lib/octocore-mongo/trendable.rb +88 -0
  99. data/lib/octocore-mongo/trends.rb +158 -0
  100. data/lib/octocore-mongo/utils.rb +90 -0
  101. data/lib/octocore-mongo/version.rb +4 -0
  102. data/octocore-mongo.gemspec +50 -0
  103. data/spec/lib/stats_spec.rb +20 -0
  104. data/spec/spec_helper.rb +103 -0
  105. metadata +545 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 15007d8ef3d634211d02ec2614ca2b336e1c55cb
4
+ data.tar.gz: 1f797a391cb0be5496ceb737773724e093c9b21b
5
+ SHA512:
6
+ metadata.gz: fab2307b81bcc3f48b3d08693f0aa930400f9c53c988f95ded693c5aee104101ed1b6763e88667c690055b61cdc3173dbbd4ccf76c2c0b619ff6a10dc778cabd
7
+ data.tar.gz: 1724f158fe910438aaec966682ab46fa8d851c23508e168574d7ca7fcab0cf30893f8929a01c2f10f82a05f3674b2536758bb43b4d93d7bb0524713b66048832
data/CHANGES.md ADDED
@@ -0,0 +1,12 @@
1
+ ## 0.0.3
2
+
3
+ - Adding `.deep_merge` in Hashes
4
+ - Storing data to create funnels
5
+
6
+ ## 0.0.2
7
+
8
+ Removed Search module as it added conflicts
9
+
10
+ ## 0.0.1
11
+
12
+ Base Gem
data/CONTRIBUTING ADDED
File without changes
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+ ruby '2.2.2'
3
+
4
+ gemspec
5
+
6
+ gem 'rake'
7
+
8
+ group :test do
9
+ gem 'rspec'
10
+ end
11
+
data/Gemfile.lock ADDED
@@ -0,0 +1,150 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ octocore-mongo (0.0.6)
5
+ active_model_serializers (~> 0.9.5, >= 0.9.5)
6
+ activemodel-serializers-xml (~> 1.0.1, >= 1.0.1)
7
+ bson_ext (~> 1.12, >= 1.12.5)
8
+ descriptive_statistics (~> 2.5.1, >= 2.5.0)
9
+ elasticsearch (~> 1.0.17, >= 1.0.17)
10
+ faraday (~> 0.9.2, >= 0.9.2)
11
+ hiredis (~> 0.6.1, >= 0.6.0)
12
+ hooks (~> 0.4.1, >= 0.4.1)
13
+ json (~> 1.8.1, >= 1.8.1)
14
+ mandrill-api (~> 1.0, >= 1.0.53)
15
+ mongo_mapper (~> 0.13.1)
16
+ rake (~> 11.1.0, >= 11.1.0)
17
+ redis (~> 3.2.2, >= 3.2.0)
18
+ redis-queue (~> 0.0.4, >= 0.0.4)
19
+ resque (~> 1.26.0, >= 1.26.0)
20
+ resque-scheduler (~> 4.1.0, >= 4.1.0)
21
+ ruby-kafka (~> 0.3.2, >= 0.3.2)
22
+ statsd-ruby (~> 1.3.0, >= 1.3.0)
23
+
24
+ GEM
25
+ remote: https://rubygems.org/
26
+ specs:
27
+ active_model_serializers (0.9.5)
28
+ activemodel (>= 3.2)
29
+ activemodel (5.0.0.1)
30
+ activesupport (= 5.0.0.1)
31
+ activemodel-serializers-xml (1.0.1)
32
+ activemodel (> 5.x)
33
+ activerecord (> 5.x)
34
+ activesupport (> 5.x)
35
+ builder (~> 3.1)
36
+ activerecord (5.0.0.1)
37
+ activemodel (= 5.0.0.1)
38
+ activesupport (= 5.0.0.1)
39
+ arel (~> 7.0)
40
+ activesupport (5.0.0.1)
41
+ concurrent-ruby (~> 1.0, >= 1.0.2)
42
+ i18n (~> 0.7)
43
+ minitest (~> 5.1)
44
+ tzinfo (~> 1.1)
45
+ arel (7.1.1)
46
+ bson (1.12.5)
47
+ bson_ext (1.12.5)
48
+ bson (~> 1.12.5)
49
+ builder (3.2.2)
50
+ concurrent-ruby (1.0.2)
51
+ descriptive_statistics (2.5.1)
52
+ diff-lcs (1.2.5)
53
+ elasticsearch (1.0.18)
54
+ elasticsearch-api (= 1.0.18)
55
+ elasticsearch-transport (= 1.0.18)
56
+ elasticsearch-api (1.0.18)
57
+ multi_json
58
+ elasticsearch-transport (1.0.18)
59
+ faraday
60
+ multi_json
61
+ excon (0.52.0)
62
+ faraday (0.9.2)
63
+ multipart-post (>= 1.2, < 3)
64
+ hiredis (0.6.1)
65
+ hooks (0.4.1)
66
+ uber (~> 0.0.14)
67
+ i18n (0.7.0)
68
+ json (1.8.3)
69
+ mandrill-api (1.0.53)
70
+ excon (>= 0.16.0, < 1.0)
71
+ json (>= 1.7.7, < 2.0)
72
+ minitest (5.9.0)
73
+ mongo (1.12.5)
74
+ bson (= 1.12.5)
75
+ mongo_mapper (0.13.1)
76
+ activemodel (>= 3.0.0)
77
+ activesupport (>= 3.0)
78
+ mongo (~> 1.8)
79
+ plucky (~> 0.6.5)
80
+ mono_logger (1.1.0)
81
+ multi_json (1.12.1)
82
+ multipart-post (2.0.0)
83
+ parallel (1.9.0)
84
+ parallel_tests (2.5.0)
85
+ parallel
86
+ plucky (0.6.6)
87
+ mongo (~> 1.5)
88
+ rack (1.6.4)
89
+ rack-protection (1.5.3)
90
+ rack
91
+ rake (11.1.2)
92
+ redis (3.2.2)
93
+ redis-namespace (1.5.2)
94
+ redis (~> 3.0, >= 3.0.4)
95
+ redis-queue (0.0.4)
96
+ hiredis (~> 0.5, >= 0.5.2)
97
+ redis (~> 3.0, >= 3.0.4)
98
+ resque (1.26.0)
99
+ mono_logger (~> 1.0)
100
+ multi_json (~> 1.0)
101
+ redis-namespace (~> 1.3)
102
+ sinatra (>= 0.9.2)
103
+ vegas (~> 0.1.2)
104
+ resque-scheduler (4.1.0)
105
+ mono_logger (~> 1.0)
106
+ redis (~> 3.0)
107
+ resque (~> 1.25)
108
+ rufus-scheduler (~> 3.0)
109
+ rspec (3.5.0)
110
+ rspec-core (~> 3.5.0)
111
+ rspec-expectations (~> 3.5.0)
112
+ rspec-mocks (~> 3.5.0)
113
+ rspec-core (3.5.3)
114
+ rspec-support (~> 3.5.0)
115
+ rspec-expectations (3.5.0)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.5.0)
118
+ rspec-mocks (3.5.0)
119
+ diff-lcs (>= 1.2.0, < 2.0)
120
+ rspec-support (~> 3.5.0)
121
+ rspec-support (3.5.0)
122
+ ruby-kafka (0.3.14)
123
+ rufus-scheduler (3.2.2)
124
+ sinatra (1.4.7)
125
+ rack (~> 1.5)
126
+ rack-protection (~> 1.4)
127
+ tilt (>= 1.3, < 3)
128
+ statsd-ruby (1.3.0)
129
+ thread_safe (0.3.5)
130
+ tilt (2.0.5)
131
+ tzinfo (1.2.2)
132
+ thread_safe (~> 0.1)
133
+ uber (0.0.15)
134
+ vegas (0.1.11)
135
+ rack (>= 1.0.0)
136
+
137
+ PLATFORMS
138
+ ruby
139
+
140
+ DEPENDENCIES
141
+ octocore-mongo!
142
+ parallel_tests (~> 2.5.0, >= 2.5.0)
143
+ rake
144
+ rspec
145
+
146
+ RUBY VERSION
147
+ ruby 2.2.2p95
148
+
149
+ BUNDLED WITH
150
+ 1.13.0
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/MAINTAINERS ADDED
File without changes
data/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ Octo.ai, (C) 2015,2016 Aurora Borealis Technologies Pvt. Ltd.
2
+
3
+ This product includes software developed at Aurora Borealis Technologies Pvt. Ltd (https://octo.ai/).
4
+
5
+ The Octoai project contains unmodified/modified subcomponents too with
6
+ separate copyright notices and license terms. Your use of the source
7
+ code for these subcomponents is subject to the terms and conditions
8
+ of the following licenses.
data/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # octocore-mongo
2
+
3
+ This is the Octomatic Enterprise Core gem for MongoDB. It provides most of the ORM stuff for MongoDB. Class and modules for different tables.
4
+
5
+ ## Installting
6
+
7
+ ```bash
8
+ gem install octocore-mongo
9
+ ```
10
+
11
+ In case you are using bundler, you need to add something like this to your Gemfile:
12
+
13
+ ```ruby
14
+ gem 'octocore-mongo', :git => 'git@github.com:octoai/gem-octocore-mongo.git'
15
+ ```
16
+
17
+
18
+
19
+ ## DB Migrations
20
+
21
+ ### OctoAdmin CLI
22
+
23
+ This gem comes with a handy utility called `octocore-admin-mongo`. You can use this utility for db migrations, reset and init.
24
+
25
+ ```bash
26
+ $ octocore-admin-mongo action path/to/config/dir
27
+ ```
28
+
29
+ Where
30
+
31
+ - `action`: The action to be performed. One of `init`, `migrate` or `reset`
32
+ - `/path/to/config/dir`: The path where your config dir is placed
33
+
34
+
35
+ # Development
36
+
37
+ ## Clone the repo
38
+
39
+ `$ git clone git@github.com:octoai/gem-octocore-mongo.git`
40
+
41
+ ## Building
42
+
43
+ ```bash
44
+ $ ./bin/clean_setup.sh
45
+ ```
46
+
47
+ ## Specs
48
+
49
+ ```bash
50
+ $ rake spec
51
+ ```
52
+
53
+ # Verifying connectivity
54
+
55
+ You can use the following set of commands in `irb` to verify all things working with this gem. Execute it from irb in PROJ_DIR.
56
+
57
+ ```ruby
58
+ require 'octocore-mongo'
59
+ config_dir = '/path/to/config/dir'
60
+ Octo.connect_with_config_file config_dir
61
+ ```
62
+
63
+ # Creating fake stream
64
+
65
+ It ships with a utility called `fakestream`. It will automatically stream random data. To use just open your console and type
66
+
67
+ ```bash
68
+ $ fakestream-mongo /path/to/config/dir
69
+ ```