cryptocoins 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/cryptocoins.iml +11 -0
- data/.idea/inspectionProfiles/Project_Default.xml +6 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +258 -0
- data/Gemfile +6 -0
- data/README.md +35 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/cryptocoins.gemspec +36 -0
- data/lib/cryptocoins/version.rb +3 -0
- data/lib/cryptocoins.rb +111 -0
- metadata +117 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bd9c3f6e8c3bbb9442003e2d9faa0685a58c784f0c7a2bd2481ea6d2fdb737f2
|
4
|
+
data.tar.gz: d9893154aab536c75be1506cb21687a41ee9e8ccde18e55196c6c67f7dc85594
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7e2825b6a44ede05c204d8a4bc375749f4c101788573b2d181db390ef873d14cb80148486319c24485990941423025f6b93207751e6ca6018a8cb38cd78395a5
|
7
|
+
data.tar.gz: 524d4425c8da734dcce57966b9c4de5eb114da83811b3c429795d9f6de174bb319ac8915047534efbc5fc10476f3a6a18af5a52251d89dd6059ba3cde647b6cd
|
data/.gitignore
ADDED
data/.idea/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<shared />
|
5
|
+
</component>
|
6
|
+
<component name="NewModuleRootManager">
|
7
|
+
<content url="file://$MODULE_DIR$" />
|
8
|
+
<orderEntry type="inheritedJdk" />
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
10
|
+
</component>
|
11
|
+
</module>
|
data/.idea/misc.xml
ADDED
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/cryptocoins.iml" filepath="$PROJECT_DIR$/.idea/cryptocoins.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
data/.idea/vcs.xml
ADDED
data/.idea/workspace.xml
ADDED
@@ -0,0 +1,258 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ChangeListManager">
|
4
|
+
<list default="true" id="201f27e6-4033-4977-92d0-397dbdbc3ad2" name="Default" comment="">
|
5
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/cryptocoins.rb" afterPath="$PROJECT_DIR$/lib/cryptocoins.rb" />
|
6
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/cryptocoins/version.rb" afterPath="$PROJECT_DIR$/lib/cryptocoins/version.rb" />
|
7
|
+
</list>
|
8
|
+
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
9
|
+
<option name="TRACKING_ENABLED" value="true" />
|
10
|
+
<option name="SHOW_DIALOG" value="false" />
|
11
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
12
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
13
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
14
|
+
</component>
|
15
|
+
<component name="FileEditorManager">
|
16
|
+
<leaf>
|
17
|
+
<file leaf-file-name="cryptocoins.rb" pinned="false" current-in-tab="true">
|
18
|
+
<entry file="file://$PROJECT_DIR$/lib/cryptocoins.rb">
|
19
|
+
<provider selected="true" editor-type-id="text-editor">
|
20
|
+
<state relative-caret-position="124">
|
21
|
+
<caret line="30" column="36" lean-forward="true" selection-start-line="30" selection-start-column="36" selection-end-line="30" selection-end-column="36" />
|
22
|
+
<folding />
|
23
|
+
</state>
|
24
|
+
</provider>
|
25
|
+
</entry>
|
26
|
+
</file>
|
27
|
+
<file leaf-file-name="cryptocoins.gemspec" pinned="false" current-in-tab="false">
|
28
|
+
<entry file="file://$PROJECT_DIR$/cryptocoins.gemspec">
|
29
|
+
<provider selected="true" editor-type-id="text-editor">
|
30
|
+
<state relative-caret-position="-1">
|
31
|
+
<caret line="1" column="1" lean-forward="false" selection-start-line="1" selection-start-column="1" selection-end-line="1" selection-end-column="1" />
|
32
|
+
<folding />
|
33
|
+
</state>
|
34
|
+
</provider>
|
35
|
+
</entry>
|
36
|
+
</file>
|
37
|
+
<file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
|
38
|
+
<entry file="file://$PROJECT_DIR$/lib/cryptocoins/version.rb">
|
39
|
+
<provider selected="true" editor-type-id="text-editor">
|
40
|
+
<state relative-caret-position="15">
|
41
|
+
<caret line="1" column="19" lean-forward="true" selection-start-line="1" selection-start-column="19" selection-end-line="1" selection-end-column="19" />
|
42
|
+
<folding />
|
43
|
+
</state>
|
44
|
+
</provider>
|
45
|
+
</entry>
|
46
|
+
</file>
|
47
|
+
</leaf>
|
48
|
+
</component>
|
49
|
+
<component name="FileTemplateManagerImpl">
|
50
|
+
<option name="RECENT_TEMPLATES">
|
51
|
+
<list>
|
52
|
+
<option value="JavaScript File" />
|
53
|
+
</list>
|
54
|
+
</option>
|
55
|
+
</component>
|
56
|
+
<component name="Git.Settings">
|
57
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
58
|
+
</component>
|
59
|
+
<component name="IdeDocumentHistory">
|
60
|
+
<option name="CHANGED_PATHS">
|
61
|
+
<list>
|
62
|
+
<option value="$PROJECT_DIR$/lib/cryptocoins/parser.js" />
|
63
|
+
<option value="$PROJECT_DIR$/cryptocoins.gemspec" />
|
64
|
+
<option value="$PROJECT_DIR$/.gitignore" />
|
65
|
+
<option value="$PROJECT_DIR$/lib/cryptocoins.rb" />
|
66
|
+
<option value="$PROJECT_DIR$/lib/cryptocoins/version.rb" />
|
67
|
+
</list>
|
68
|
+
</option>
|
69
|
+
</component>
|
70
|
+
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
71
|
+
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
|
72
|
+
<component name="JsGulpfileManager">
|
73
|
+
<detection-done>true</detection-done>
|
74
|
+
<sorting>DEFINITION_ORDER</sorting>
|
75
|
+
</component>
|
76
|
+
<component name="ProjectFrameBounds" fullScreen="true">
|
77
|
+
<option name="width" value="1280" />
|
78
|
+
<option name="height" value="800" />
|
79
|
+
</component>
|
80
|
+
<component name="ProjectView">
|
81
|
+
<navigator currentView="ProjectPane" proportions="" version="1">
|
82
|
+
<flattenPackages />
|
83
|
+
<showMembers />
|
84
|
+
<showModules />
|
85
|
+
<showLibraryContents />
|
86
|
+
<hideEmptyPackages />
|
87
|
+
<abbreviatePackageNames />
|
88
|
+
<autoscrollToSource />
|
89
|
+
<autoscrollFromSource />
|
90
|
+
<sortByType />
|
91
|
+
<manualOrder />
|
92
|
+
<foldersAlwaysOnTop value="true" />
|
93
|
+
</navigator>
|
94
|
+
<panes>
|
95
|
+
<pane id="ProjectPane">
|
96
|
+
<subPane>
|
97
|
+
<expand>
|
98
|
+
<path>
|
99
|
+
<item name="cryptocoins" type="b2602c69:ProjectViewProjectNode" />
|
100
|
+
<item name="cryptocoins" type="462c0819:PsiDirectoryNode" />
|
101
|
+
</path>
|
102
|
+
<path>
|
103
|
+
<item name="cryptocoins" type="b2602c69:ProjectViewProjectNode" />
|
104
|
+
<item name="cryptocoins" type="462c0819:PsiDirectoryNode" />
|
105
|
+
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
106
|
+
</path>
|
107
|
+
<path>
|
108
|
+
<item name="cryptocoins" type="b2602c69:ProjectViewProjectNode" />
|
109
|
+
<item name="cryptocoins" type="462c0819:PsiDirectoryNode" />
|
110
|
+
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
111
|
+
<item name="cryptocoins" type="462c0819:PsiDirectoryNode" />
|
112
|
+
</path>
|
113
|
+
</expand>
|
114
|
+
<select />
|
115
|
+
</subPane>
|
116
|
+
</pane>
|
117
|
+
<pane id="Scratches" />
|
118
|
+
<pane id="Scope" />
|
119
|
+
</panes>
|
120
|
+
</component>
|
121
|
+
<component name="PropertiesComponent">
|
122
|
+
<property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.ruby.settings.RubyActiveModuleSdkConfigurable" />
|
123
|
+
<property name="WebServerToolWindowFactoryState" value="false" />
|
124
|
+
</component>
|
125
|
+
<component name="RunDashboard">
|
126
|
+
<option name="ruleStates">
|
127
|
+
<list>
|
128
|
+
<RuleState>
|
129
|
+
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
130
|
+
</RuleState>
|
131
|
+
<RuleState>
|
132
|
+
<option name="name" value="StatusDashboardGroupingRule" />
|
133
|
+
</RuleState>
|
134
|
+
</list>
|
135
|
+
</option>
|
136
|
+
</component>
|
137
|
+
<component name="ShelveChangesManager" show_recycled="false">
|
138
|
+
<option name="remove_strategy" value="false" />
|
139
|
+
</component>
|
140
|
+
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" />
|
141
|
+
<component name="TaskManager">
|
142
|
+
<task active="true" id="Default" summary="Default task">
|
143
|
+
<changelist id="201f27e6-4033-4977-92d0-397dbdbc3ad2" name="Default" comment="" />
|
144
|
+
<created>1516413793493</created>
|
145
|
+
<option name="number" value="Default" />
|
146
|
+
<option name="presentableId" value="Default" />
|
147
|
+
<updated>1516413793493</updated>
|
148
|
+
<workItem from="1516413803479" duration="19956000" />
|
149
|
+
</task>
|
150
|
+
<servers />
|
151
|
+
</component>
|
152
|
+
<component name="TimeTrackingManager">
|
153
|
+
<option name="totallyTimeSpent" value="19956000" />
|
154
|
+
</component>
|
155
|
+
<component name="ToolWindowManager">
|
156
|
+
<frame x="0" y="0" width="1280" height="800" extended-state="0" />
|
157
|
+
<editor active="true" />
|
158
|
+
<layout>
|
159
|
+
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24959612" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
160
|
+
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
161
|
+
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32991204" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
162
|
+
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.3252841" sideWeight="0.51130855" order="-1" side_tool="true" content_ui="tabs" />
|
163
|
+
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
164
|
+
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
165
|
+
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
166
|
+
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
167
|
+
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3243626" sideWeight="0.48869145" order="-1" side_tool="false" content_ui="tabs" />
|
168
|
+
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
169
|
+
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
170
|
+
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
171
|
+
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
172
|
+
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
173
|
+
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
174
|
+
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
175
|
+
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
176
|
+
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
177
|
+
</layout>
|
178
|
+
</component>
|
179
|
+
<component name="TypeScriptGeneratedFilesManager">
|
180
|
+
<option name="version" value="1" />
|
181
|
+
</component>
|
182
|
+
<component name="VcsContentAnnotationSettings">
|
183
|
+
<option name="myLimit" value="2678400000" />
|
184
|
+
</component>
|
185
|
+
<component name="XDebuggerManager">
|
186
|
+
<breakpoint-manager />
|
187
|
+
<watches-manager />
|
188
|
+
</component>
|
189
|
+
<component name="editorHistoryManager">
|
190
|
+
<entry file="file://$PROJECT_DIR$/Rakefile">
|
191
|
+
<provider selected="true" editor-type-id="text-editor">
|
192
|
+
<state relative-caret-position="0">
|
193
|
+
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
194
|
+
<folding />
|
195
|
+
</state>
|
196
|
+
</provider>
|
197
|
+
</entry>
|
198
|
+
<entry file="file://$PROJECT_DIR$/README.md">
|
199
|
+
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
200
|
+
<state split_layout="SPLIT">
|
201
|
+
<first_editor relative-caret-position="0">
|
202
|
+
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
203
|
+
<folding />
|
204
|
+
</first_editor>
|
205
|
+
<second_editor />
|
206
|
+
</state>
|
207
|
+
</provider>
|
208
|
+
</entry>
|
209
|
+
<entry file="file://$PROJECT_DIR$/Gemfile">
|
210
|
+
<provider selected="true" editor-type-id="text-editor">
|
211
|
+
<state relative-caret-position="0">
|
212
|
+
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
213
|
+
<folding />
|
214
|
+
</state>
|
215
|
+
</provider>
|
216
|
+
</entry>
|
217
|
+
<entry file="file://$PROJECT_DIR$/lib/cryptocoins/parser.js">
|
218
|
+
<provider selected="true" editor-type-id="text-editor">
|
219
|
+
<state relative-caret-position="360">
|
220
|
+
<caret line="24" column="49" lean-forward="false" selection-start-line="24" selection-start-column="49" selection-end-line="24" selection-end-column="49" />
|
221
|
+
<folding />
|
222
|
+
</state>
|
223
|
+
</provider>
|
224
|
+
</entry>
|
225
|
+
<entry file="file://$PROJECT_DIR$/.gitignore">
|
226
|
+
<provider selected="true" editor-type-id="text-editor">
|
227
|
+
<state relative-caret-position="135">
|
228
|
+
<caret line="9" column="8" lean-forward="true" selection-start-line="9" selection-start-column="8" selection-end-line="9" selection-end-column="8" />
|
229
|
+
<folding />
|
230
|
+
</state>
|
231
|
+
</provider>
|
232
|
+
</entry>
|
233
|
+
<entry file="file://$PROJECT_DIR$/cryptocoins.gemspec">
|
234
|
+
<provider selected="true" editor-type-id="text-editor">
|
235
|
+
<state relative-caret-position="-1">
|
236
|
+
<caret line="1" column="1" lean-forward="false" selection-start-line="1" selection-start-column="1" selection-end-line="1" selection-end-column="1" />
|
237
|
+
<folding />
|
238
|
+
</state>
|
239
|
+
</provider>
|
240
|
+
</entry>
|
241
|
+
<entry file="file://$PROJECT_DIR$/lib/cryptocoins/version.rb">
|
242
|
+
<provider selected="true" editor-type-id="text-editor">
|
243
|
+
<state relative-caret-position="15">
|
244
|
+
<caret line="1" column="19" lean-forward="true" selection-start-line="1" selection-start-column="19" selection-end-line="1" selection-end-column="19" />
|
245
|
+
<folding />
|
246
|
+
</state>
|
247
|
+
</provider>
|
248
|
+
</entry>
|
249
|
+
<entry file="file://$PROJECT_DIR$/lib/cryptocoins.rb">
|
250
|
+
<provider selected="true" editor-type-id="text-editor">
|
251
|
+
<state relative-caret-position="124">
|
252
|
+
<caret line="30" column="36" lean-forward="true" selection-start-line="30" selection-start-column="36" selection-end-line="30" selection-end-column="36" />
|
253
|
+
<folding />
|
254
|
+
</state>
|
255
|
+
</provider>
|
256
|
+
</entry>
|
257
|
+
</component>
|
258
|
+
</project>
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Cryptocoins
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cryptocoins`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'cryptocoins'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install cryptocoins
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cryptocoins.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "cryptocoins"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/cryptocoins.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "cryptocoins/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "cryptocoins"
|
8
|
+
spec.version = CryptoCoins::VERSION
|
9
|
+
spec.authors = ["teamdawi"]
|
10
|
+
spec.email = ["brett@teamdawi.com"]
|
11
|
+
spec.licenses = ['MIT']
|
12
|
+
spec.summary = %q{Crytocurrency Api using CoinMarketCaps Data and gathers News from sources}
|
13
|
+
spec.description = %q{Data and News Api for CryptoCurrencies}
|
14
|
+
spec.homepage = "https://github.com/bdawidowski/cryptocoins"
|
15
|
+
spec.metadata = { "source_code_uri" => "https://github.com/bdawidowski/cryptocoins" }
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
+
# if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
# else
|
21
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
22
|
+
# "public gem pushes."
|
23
|
+
# end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
f.match(%r{^(test|spec|features)/})
|
27
|
+
end
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
33
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
34
|
+
spec.add_development_dependency "httparty", "~> 0.13.7"
|
35
|
+
spec.add_development_dependency "nokogiri", "~> 1.8"
|
36
|
+
end
|
data/lib/cryptocoins.rb
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
require 'cryptocoins/version'
|
2
|
+
require 'httparty'
|
3
|
+
require 'open-uri'
|
4
|
+
require 'nokogiri'
|
5
|
+
|
6
|
+
module CryptoCoins
|
7
|
+
class Coin
|
8
|
+
def self.top(limit)
|
9
|
+
options = {query: { limit: limit.to_s}}
|
10
|
+
return HTTParty.get('https://api.coinmarketcap.com/v1/ticker/?', options)
|
11
|
+
end
|
12
|
+
def self.find(ticker)
|
13
|
+
response = HTTParty.get('https://api.coinmarketcap.com/v1/ticker/')
|
14
|
+
response.each do |coin|
|
15
|
+
if coin['symbol'] == ticker.upcase or coin['id'] == ticker.downcase or coin['name'].downcase == ticker.downcase
|
16
|
+
return coin
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
def self.markets(ticker)
|
21
|
+
markets_json = {
|
22
|
+
ticker.downcase => []
|
23
|
+
}
|
24
|
+
begin
|
25
|
+
markets_table = Nokogiri::HTML(open("https://coinmarketcap.com/currencies/#{self.find(ticker)['id']}/"))
|
26
|
+
markets_table = markets_table.xpath("//table[@id = 'markets-table']/tbody")
|
27
|
+
markets_table.search('tr').each do |row|
|
28
|
+
tds = row.search('td')
|
29
|
+
item_json = {
|
30
|
+
'rank' => tds[0].text,
|
31
|
+
'name' => tds[1].text,
|
32
|
+
'pair' => tds[2].text,
|
33
|
+
'link' => tds[2].xpath('./a/@href').first.value,
|
34
|
+
'24h_volume_usd' => tds[3].xpath('./span/@data-usd').first.value,
|
35
|
+
'24h_volume_btc' => tds[3].xpath('./span/@data-btc').first.value,
|
36
|
+
'24h_volume_native' => tds[3].xpath('./span/@data-native').first.value,
|
37
|
+
'price_usd' => tds[4].xpath('./span/@data-usd').first.value,
|
38
|
+
'price_btc' => tds[4].xpath('./span/@data-btc').first.value,
|
39
|
+
'price_native' => tds[4].xpath('./span/@data-native').first.value,
|
40
|
+
'percent_volume' => tds[5].xpath('./span/@data-format-value').first.value
|
41
|
+
}
|
42
|
+
markets_json[ticker.downcase] << item_json
|
43
|
+
end
|
44
|
+
return markets_json
|
45
|
+
rescue
|
46
|
+
error = {
|
47
|
+
'error' => "Invaild HTTP Request! **#{ticker.upcase}** Coin Not Supported!"
|
48
|
+
}
|
49
|
+
markets_json[ticker.downcase] = []
|
50
|
+
markets_json[ticker.downcase] << error
|
51
|
+
return markets_json
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
class Market
|
56
|
+
def self.coins(market)
|
57
|
+
coins_json = {
|
58
|
+
market.downcase => []
|
59
|
+
}
|
60
|
+
begin
|
61
|
+
coins_table = Nokogiri::HTML(open("https://coinmarketcap.com/exchanges/#{market.downcase}/"))
|
62
|
+
coins_table = coins_table.xpath("//div[@class = 'table-responsive']/table")
|
63
|
+
coins_table.search('tr').each_with_index do |row, i|
|
64
|
+
if i > 0
|
65
|
+
tds = row.search('td')
|
66
|
+
item_json = {
|
67
|
+
'rank' => tds[0].text,
|
68
|
+
'name' => tds[1].text,
|
69
|
+
'icon' => tds[1].xpath('./img/@src').first.value,
|
70
|
+
'link' => tds[2].xpath('./a/@href').first.value,
|
71
|
+
'pair' => tds[2].text,
|
72
|
+
'24h_volume_usd' => tds[3].xpath('./span/@data-usd').first.value,
|
73
|
+
'24h_volume_btc' => tds[3].xpath('./span/@data-btc').first.value,
|
74
|
+
'24h_volume_native' => tds[3].xpath('./span/@data-native').first.value,
|
75
|
+
'price_usd' => tds[4].xpath('./span/@data-usd').first.value,
|
76
|
+
'price_btc' => tds[4].xpath('./span/@data-btc').first.value,
|
77
|
+
'price_native' => tds[4].xpath('./span/@data-native').first.value,
|
78
|
+
'percent_volume' => tds[5].text.gsub('[\s\r\n%]+', '')
|
79
|
+
}
|
80
|
+
end
|
81
|
+
coins_json[market.downcase] << item_json
|
82
|
+
end
|
83
|
+
return coins_json
|
84
|
+
rescue
|
85
|
+
error = {
|
86
|
+
'error' => "Invaild HTTP Request! **#{market.upcase}** Exchange Not Supported!"
|
87
|
+
}
|
88
|
+
coins_json[market.downcase] = []
|
89
|
+
coins_json[market.downcase] << error
|
90
|
+
return coins_json
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
class News
|
95
|
+
def self.search(keywords, secret_key)
|
96
|
+
today = Date.today.strftime('%Y-%m-%d')
|
97
|
+
yesterday = Date.today.prev_day.strftime('%Y-%m-%d')
|
98
|
+
options = {query: {language: 'en',
|
99
|
+
sortBy: 'popularity',
|
100
|
+
apiKey: secret_key,
|
101
|
+
from: yesterday,
|
102
|
+
to: today,
|
103
|
+
q: keywords,
|
104
|
+
pageSize: '100'}}
|
105
|
+
return HTTParty.get('https://newsapi.org/v2/everything?', options)['articles']
|
106
|
+
end
|
107
|
+
def self.bitcoin(secret_key)
|
108
|
+
return self.search('+bitcoin', secret_key)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cryptocoins
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- teamdawi
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-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.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
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: httparty
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.13.7
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.13.7
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: nokogiri
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.8'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.8'
|
69
|
+
description: Data and News Api for CryptoCurrencies
|
70
|
+
email:
|
71
|
+
- brett@teamdawi.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".idea/.rakeTasks"
|
78
|
+
- ".idea/cryptocoins.iml"
|
79
|
+
- ".idea/inspectionProfiles/Project_Default.xml"
|
80
|
+
- ".idea/misc.xml"
|
81
|
+
- ".idea/modules.xml"
|
82
|
+
- ".idea/vcs.xml"
|
83
|
+
- ".idea/workspace.xml"
|
84
|
+
- Gemfile
|
85
|
+
- README.md
|
86
|
+
- Rakefile
|
87
|
+
- bin/console
|
88
|
+
- bin/setup
|
89
|
+
- cryptocoins.gemspec
|
90
|
+
- lib/cryptocoins.rb
|
91
|
+
- lib/cryptocoins/version.rb
|
92
|
+
homepage: https://github.com/bdawidowski/cryptocoins
|
93
|
+
licenses:
|
94
|
+
- MIT
|
95
|
+
metadata:
|
96
|
+
source_code_uri: https://github.com/bdawidowski/cryptocoins
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.7.4
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: Crytocurrency Api using CoinMarketCaps Data and gathers News from sources
|
117
|
+
test_files: []
|