my_shows 0.0.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.
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .idea/workspace.xml
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/.idea/.name ADDED
@@ -0,0 +1 @@
1
+ my_shows
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"><RakeTask description="Build my_shows-0.0.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install my_shows-0.0.1.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.0.1 and build and push my_shows-0.0.1.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
+ </project>
5
+
data/.idea/misc.xml ADDED
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectInspectionProfilesVisibleTreeState">
4
+ <entry key="Project Default">
5
+ <profile-state>
6
+ <expanded-state>
7
+ <State>
8
+ <id />
9
+ </State>
10
+ </expanded-state>
11
+ <selected-state>
12
+ <State>
13
+ <id>CSS</id>
14
+ </State>
15
+ </selected-state>
16
+ </profile-state>
17
+ </entry>
18
+ </component>
19
+ <component name="ProjectResources">
20
+ <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
21
+ </component>
22
+ <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-1.9.3-p374" project-jdk-type="RUBY_SDK" />
23
+ <component name="RegexUtilComponent" text="1900-01-01 2007/08/13 1900.01.01 1900 01 01 1900-01.01 1900 13 01 1900 02 31" flags="0" regex="(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])" mode="0" />
24
+ </project>
25
+
data/.idea/modules.xml ADDED
@@ -0,0 +1,9 @@
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/my_shows.iml" filepath="$PROJECT_DIR$/.idea/my_shows.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
9
+
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="gem" name="Gem">
5
+ <configuration>
6
+ <option name="GEM_APP_ROOT_PATH" value="" />
7
+ <option name="GEM_APP_TEST_PATH" value="" />
8
+ <option name="GEM_APP_LIB_PATH" value="" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="NewModuleRootManager">
13
+ <content url="file://$MODULE_DIR$" />
14
+ <orderEntry type="inheritedJdk" />
15
+ <orderEntry type="sourceFolder" forTests="false" />
16
+ <orderEntry type="library" scope="PROVIDED" name="RubyInline (v3.11.4, RVM: ruby-1.9.3-p374) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="ZenTest (v4.8.3, RVM: ruby-1.9.3-p374) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="awesome_print (v1.1.0, RVM: ruby-1.9.3-p374) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.2.3, RVM: ruby-1.9.3-p374) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="colorize (v0.5.8, RVM: ruby-1.9.3-p374) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="faraday (v0.8.4, RVM: ruby-1.9.3-p374) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="faraday_middleware (v0.9.0, RVM: ruby-1.9.3-p374) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="fuzzy-string-match (v0.9.4, RVM: ruby-1.9.3-p374) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="hashie (v1.2.0, RVM: ruby-1.9.3-p374) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="multipart-post (v1.1.5, RVM: ruby-1.9.3-p374) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="netrc (v0.7.7, RVM: ruby-1.9.3-p374) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.5.6, RVM: ruby-1.9.3-p374) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.0.2, RVM: ruby-1.9.3-p374) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.12.1, RVM: ruby-1.9.3-p374) [gem]" level="application" />
30
+ </component>
31
+ </module>
32
+
@@ -0,0 +1,5 @@
1
+ <component name="DependencyValidationManager">
2
+ <state>
3
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
+ </state>
5
+ </component>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
7
+
@@ -0,0 +1,500 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="BuildServerSettings">
4
+ <option name="LOGIN" value="" />
5
+ <option name="SERVER_URL" value="http://buildserver" />
6
+ <option name="PASSWORD" />
7
+ <option name="REMEMBER_ME" value="true" />
8
+ <option name="USE_IDEA_PROXY_SETTINGS" value="true" />
9
+ <option name="INSPECTIONS_BUILD_TYPE_IDS" />
10
+ <option name="DUPLICATES_BUILD_TYPE_IDS" />
11
+ <option name="COVERAGE_SETTINGS" />
12
+ <option name="ARTIFACTS_BUILD_TYPE_IDS" />
13
+ <option name="PERFORM_COMMIT_IF_SUCCESSFUL" value="true" />
14
+ <option name="PERFORM_COMMIT_IF_NO_NEW_FAILED_TESTS" value="false" />
15
+ <option name="REQUEST_CONFIRMATON" value="false" />
16
+ <option name="PRE_TESTED_COMMIT" value="true" />
17
+ <option name="PROJECT_STATUS_DIALOG_SPLITTER_DIVIDER_LOCATION" value="500" />
18
+ <option name="CHANGES_STATUS_DIALOG_SPLITTER_DIVIDER_LOCATION" value="500" />
19
+ <option name="FILTER_BY_STATUS" value="false" />
20
+ <option name="SHOW_CLOSE_PROMPT" value="true" />
21
+ <option name="TOOL_WINDOW_SELECTED_CONTENT_INDEX" value="0" />
22
+ <option name="FILTER_BY_CURRENT_PROJECT" value="true" />
23
+ </component>
24
+ <component name="ChangeListManager">
25
+ <list default="true" id="b8a06343-05e1-48c1-adc0-72f80e58d54c" name="Default" comment="">
26
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/my_shows/episode.rb" />
27
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
28
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/my_shows.gemspec" afterPath="$PROJECT_DIR$/my_shows.gemspec" />
29
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/my_shows.iml" afterPath="$PROJECT_DIR$/.idea/my_shows.iml" />
30
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/my_shows.rb" afterPath="$PROJECT_DIR$/lib/my_shows.rb" />
31
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/my_shows/show.rb" afterPath="$PROJECT_DIR$/lib/my_shows/show.rb" />
32
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
33
+ </list>
34
+ <ignored path="my_shows.iws" />
35
+ <ignored path=".idea/workspace.xml" />
36
+ <file path="/my_shows.rb" changelist="b8a06343-05e1-48c1-adc0-72f80e58d54c" time="1360012347985" ignored="false" />
37
+ <file path="/sidereel_client.rb" changelist="b8a06343-05e1-48c1-adc0-72f80e58d54c" time="1354129857724" ignored="false" />
38
+ <file path="/Dummy.txt" changelist="b8a06343-05e1-48c1-adc0-72f80e58d54c" time="1360005900928" ignored="false" />
39
+ <file path="/episode.rb" changelist="b8a06343-05e1-48c1-adc0-72f80e58d54c" time="1360009444104" ignored="false" />
40
+ <file path="/show.rb" changelist="b8a06343-05e1-48c1-adc0-72f80e58d54c" time="1360008370570" ignored="false" />
41
+ <file path="/temp.rb" changelist="b8a06343-05e1-48c1-adc0-72f80e58d54c" time="1360009106254" ignored="false" />
42
+ <option name="TRACKING_ENABLED" value="true" />
43
+ <option name="SHOW_DIALOG" value="false" />
44
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
45
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
46
+ <option name="LAST_RESOLUTION" value="IGNORE" />
47
+ </component>
48
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
49
+ <component name="CreatePatchCommitExecutor">
50
+ <option name="PATCH_PATH" value="" />
51
+ </component>
52
+ <component name="DaemonCodeAnalyzer">
53
+ <disable_hints />
54
+ </component>
55
+ <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
56
+ <component name="FileEditorManager">
57
+ <leaf>
58
+ <file leaf-file-name="my_shows.rb" pinned="false" current="true" current-in-tab="true">
59
+ <entry file="file://$PROJECT_DIR$/lib/my_shows.rb">
60
+ <provider selected="true" editor-type-id="text-editor">
61
+ <state line="64" column="29" selection-start="1380" selection-end="1380" vertical-scroll-proportion="0.9074492">
62
+ <folding />
63
+ </state>
64
+ </provider>
65
+ </entry>
66
+ </file>
67
+ <file leaf-file-name="auth.rb" pinned="false" current="false" current-in-tab="false">
68
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/auth.rb">
69
+ <provider selected="true" editor-type-id="text-editor">
70
+ <state line="29" column="8" selection-start="426" selection-end="426" vertical-scroll-proportion="0.0">
71
+ <folding />
72
+ </state>
73
+ </provider>
74
+ </entry>
75
+ </file>
76
+ </leaf>
77
+ </component>
78
+ <component name="FindManager">
79
+ <FindUsagesManager>
80
+ <setting name="OPEN_NEW_TAB" value="false" />
81
+ </FindUsagesManager>
82
+ </component>
83
+ <component name="Git.Settings">
84
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
85
+ </component>
86
+ <component name="GitLogSettings">
87
+ <option name="myDateState">
88
+ <MyDateState />
89
+ </option>
90
+ </component>
91
+ <component name="IdeDocumentHistory">
92
+ <option name="changedFiles">
93
+ <list>
94
+ <option value="$USER_HOME$/.rvm/gems/ruby-1.9.3-p125/gems/torrentz-0.0.2/lib/torrentz/search.rb" />
95
+ <option value="$PROJECT_DIR$/Gemfile" />
96
+ <option value="$USER_HOME$/.rvm/gems/ruby-1.9.3-p327@global/gems/faraday-0.8.4/lib/faraday/response/logger.rb" />
97
+ <option value="$PROJECT_DIR$/lib/my_shows/logger.rb" />
98
+ <option value="$USER_HOME$/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/logger.rb" />
99
+ <option value="$PROJECT_DIR$/lib/my_shows/auth.rb" />
100
+ <option value="$PROJECT_DIR$/lib/my_shows/the_pirate_bay_client.rb" />
101
+ <option value="$PROJECT_DIR$/lib/my_shows/sidereel_client.rb" />
102
+ <option value="$PROJECT_DIR$/bin/my_shows" />
103
+ <option value="$PROJECT_DIR$/lib/my_shows/show.rb" />
104
+ <option value="$PROJECT_DIR$/lib/my_shows/episode.rb" />
105
+ <option value="$PROJECT_DIR$/lib/my_shows.rb" />
106
+ </list>
107
+ </option>
108
+ </component>
109
+ <component name="ProjectFrameBounds">
110
+ <option name="y" value="22" />
111
+ <option name="width" value="1280" />
112
+ <option name="height" value="774" />
113
+ </component>
114
+ <component name="ProjectLevelVcsManager" settingsEditedManually="true">
115
+ <OptionsSetting value="true" id="Add" />
116
+ <OptionsSetting value="true" id="Remove" />
117
+ <OptionsSetting value="true" id="Checkout" />
118
+ <OptionsSetting value="true" id="Update" />
119
+ <OptionsSetting value="true" id="Status" />
120
+ <OptionsSetting value="true" id="Edit" />
121
+ <ConfirmationsSetting value="0" id="Add" />
122
+ <ConfirmationsSetting value="0" id="Remove" />
123
+ </component>
124
+ <component name="ProjectReloadState">
125
+ <option name="STATE" value="0" />
126
+ </component>
127
+ <component name="ProjectView">
128
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
129
+ <flattenPackages />
130
+ <showMembers />
131
+ <showModules />
132
+ <showLibraryContents />
133
+ <hideEmptyPackages />
134
+ <abbreviatePackageNames />
135
+ <autoscrollToSource />
136
+ <autoscrollFromSource ProjectPane="true" />
137
+ <sortByType />
138
+ </navigator>
139
+ <panes>
140
+ <pane id="ProjectPane">
141
+ <subPane>
142
+ <PATH>
143
+ <PATH_ELEMENT>
144
+ <option name="myItemId" value="my_shows" />
145
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
146
+ </PATH_ELEMENT>
147
+ <PATH_ELEMENT>
148
+ <option name="myItemId" value="External Libraries" />
149
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
150
+ </PATH_ELEMENT>
151
+ </PATH>
152
+ <PATH>
153
+ <PATH_ELEMENT>
154
+ <option name="myItemId" value="my_shows" />
155
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
156
+ </PATH_ELEMENT>
157
+ <PATH_ELEMENT>
158
+ <option name="myItemId" value="my_shows" />
159
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
160
+ </PATH_ELEMENT>
161
+ </PATH>
162
+ <PATH>
163
+ <PATH_ELEMENT>
164
+ <option name="myItemId" value="my_shows" />
165
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
166
+ </PATH_ELEMENT>
167
+ <PATH_ELEMENT>
168
+ <option name="myItemId" value="my_shows" />
169
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
170
+ </PATH_ELEMENT>
171
+ <PATH_ELEMENT>
172
+ <option name="myItemId" value="lib" />
173
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
174
+ </PATH_ELEMENT>
175
+ </PATH>
176
+ <PATH>
177
+ <PATH_ELEMENT>
178
+ <option name="myItemId" value="my_shows" />
179
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
180
+ </PATH_ELEMENT>
181
+ <PATH_ELEMENT>
182
+ <option name="myItemId" value="my_shows" />
183
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
184
+ </PATH_ELEMENT>
185
+ <PATH_ELEMENT>
186
+ <option name="myItemId" value="lib" />
187
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
188
+ </PATH_ELEMENT>
189
+ <PATH_ELEMENT>
190
+ <option name="myItemId" value="my_shows" />
191
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
192
+ </PATH_ELEMENT>
193
+ </PATH>
194
+ <PATH>
195
+ <PATH_ELEMENT>
196
+ <option name="myItemId" value="my_shows" />
197
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
198
+ </PATH_ELEMENT>
199
+ <PATH_ELEMENT>
200
+ <option name="myItemId" value="my_shows" />
201
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
202
+ </PATH_ELEMENT>
203
+ <PATH_ELEMENT>
204
+ <option name="myItemId" value="bin" />
205
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
206
+ </PATH_ELEMENT>
207
+ </PATH>
208
+ </subPane>
209
+ </pane>
210
+ <pane id="Scope">
211
+ <subPane subId="Default">
212
+ <PATH>
213
+ <PATH_ELEMENT USER_OBJECT="Root">
214
+ <option name="myItemId" value="" />
215
+ <option name="myItemType" value="" />
216
+ </PATH_ELEMENT>
217
+ </PATH>
218
+ </subPane>
219
+ </pane>
220
+ </panes>
221
+ </component>
222
+ <component name="PropertiesComponent">
223
+ <property name="options.splitter.main.proportions" value="0.3" />
224
+ <property name="WebServerToolWindowFactoryState" value="false" />
225
+ <property name="options.lastSelected" value="project.propVCSSupport.Mappings" />
226
+ <property name="recentsLimit" value="5" />
227
+ <property name="last_opened_file_path" value="$PROJECT_DIR$/../handy" />
228
+ <property name="FullScreen" value="false" />
229
+ <property name="options.splitter.details.proportions" value="0.2" />
230
+ <property name="options.searchVisible" value="true" />
231
+ <property name="GoToClass.includeJavaFiles" value="false" />
232
+ </component>
233
+ <component name="RunManager" selected="Ruby.my_shows">
234
+ <configuration default="false" name="my_shows" type="RubyRunConfigurationType" factoryName="Ruby" temporary="true">
235
+ <module name="my_shows" />
236
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
237
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$PROJECT_DIR$/lib" />
238
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
239
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
240
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
241
+ <envs />
242
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
243
+ <EXTENSION ID="JRubyRunConfigurationExtension" />
244
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
245
+ <COVERAGE_PATTERN ENABLED="true">
246
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
247
+ </COVERAGE_PATTERN>
248
+ </EXTENSION>
249
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
250
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$PROJECT_DIR$/lib/my_shows.rb" />
251
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
252
+ <RunnerSettings RunnerId="RubyRunner" />
253
+ <ConfigurationWrapper RunnerId="RubyRunner" />
254
+ <method />
255
+ </configuration>
256
+ <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
257
+ <module name="" />
258
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
259
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
260
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
261
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
262
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
263
+ <envs />
264
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
265
+ <EXTENSION ID="JRubyRunConfigurationExtension" />
266
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
267
+ <COVERAGE_PATTERN ENABLED="true">
268
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
269
+ </COVERAGE_PATTERN>
270
+ </EXTENSION>
271
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
272
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
273
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
274
+ <method />
275
+ </configuration>
276
+ <list size="1">
277
+ <item index="0" class="java.lang.String" itemvalue="Ruby.my_shows" />
278
+ </list>
279
+ <recent_temporary>
280
+ <list size="1">
281
+ <item index="0" class="java.lang.String" itemvalue="Ruby.my_shows" />
282
+ </list>
283
+ </recent_temporary>
284
+ </component>
285
+ <component name="ShelveChangesManager" show_recycled="false" />
286
+ <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false">
287
+ <option name="USER" value="" />
288
+ <option name="PASSWORD" value="" />
289
+ <option name="mySSHConnectionTimeout" value="30000" />
290
+ <option name="mySSHReadTimeout" value="30000" />
291
+ <option name="LAST_MERGED_REVISION" />
292
+ <option name="MERGE_DRY_RUN" value="false" />
293
+ <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
294
+ <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
295
+ <option name="IGNORE_SPACES_IN_MERGE" value="false" />
296
+ <option name="DETECT_NESTED_COPIES" value="true" />
297
+ <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
298
+ <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
299
+ <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
300
+ <option name="FORCE_UPDATE" value="false" />
301
+ <option name="IGNORE_EXTERNALS" value="false" />
302
+ <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
303
+ </component>
304
+ <component name="TaskManager">
305
+ <task active="true" id="Default" summary="Default task">
306
+ <changelist id="b8a06343-05e1-48c1-adc0-72f80e58d54c" name="Default" comment="" />
307
+ <created>1352055474325</created>
308
+ <updated>1352055474325</updated>
309
+ </task>
310
+ <servers />
311
+ </component>
312
+ <component name="ToolWindowManager">
313
+ <frame x="0" y="22" width="1280" height="774" extended-state="0" />
314
+ <editor active="false" />
315
+ <layout>
316
+ <window_info id="Changes" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32905984" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
317
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
318
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32905984" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
319
+ <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
320
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
321
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24921875" sideWeight="0.67094016" order="0" side_tool="false" content_ui="combo" />
322
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
323
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24959481" sideWeight="0.53471196" order="2" side_tool="true" content_ui="tabs" />
324
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
325
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.46438748" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
326
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
327
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
328
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
329
+ <window_info id="Heroku" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
330
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
331
+ <window_info id="TeamCity" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
332
+ <window_info id="TaskBrowser" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293944" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
333
+ <window_info id="Regex Tester" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
334
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
335
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
336
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
337
+ <window_info id="JsTestDriver Server" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
338
+ </layout>
339
+ </component>
340
+ <component name="VcsContentAnnotationSettings">
341
+ <option name="myLimit" value="2678400000" />
342
+ </component>
343
+ <component name="VcsManagerConfiguration">
344
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
345
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
346
+ <option name="CHECK_NEW_TODO" value="true" />
347
+ <option name="myTodoPanelSettings">
348
+ <value>
349
+ <are-packages-shown value="false" />
350
+ <are-modules-shown value="false" />
351
+ <flatten-packages value="false" />
352
+ <is-autoscroll-to-source value="false" />
353
+ </value>
354
+ </option>
355
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
356
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
357
+ <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
358
+ <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
359
+ <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
360
+ <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
361
+ <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
362
+ <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
363
+ <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
364
+ <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
365
+ <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
366
+ <option name="SHORT_DIFF_HORISONTALLY" value="true" />
367
+ <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
368
+ <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
369
+ <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
370
+ <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
371
+ <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
372
+ <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
373
+ <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
374
+ <option name="LIMIT_HISTORY" value="true" />
375
+ <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
376
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
377
+ <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
378
+ <option name="LAST_COMMIT_MESSAGE" />
379
+ <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
380
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
381
+ <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
382
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
383
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
384
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
385
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
386
+ <option name="ACTIVE_VCS_NAME" />
387
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
388
+ <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
389
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
390
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
391
+ </component>
392
+ <component name="XDebuggerManager">
393
+ <breakpoint-manager />
394
+ </component>
395
+ <component name="editorHistoryManager">
396
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/show.rb">
397
+ <provider selected="true" editor-type-id="text-editor">
398
+ <state line="15" column="50" selection-start="518" selection-end="518" vertical-scroll-proportion="0.0">
399
+ <folding />
400
+ </state>
401
+ </provider>
402
+ </entry>
403
+ <entry file="file://$PROJECT_DIR$/lib/my_shows.rb">
404
+ <provider selected="true" editor-type-id="text-editor">
405
+ <state line="16" column="39" selection-start="324" selection-end="324" vertical-scroll-proportion="0.0">
406
+ <folding />
407
+ </state>
408
+ </provider>
409
+ </entry>
410
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/show.rb">
411
+ <provider selected="true" editor-type-id="text-editor">
412
+ <state line="9" column="68" selection-start="217" selection-end="217" vertical-scroll-proportion="0.0">
413
+ <folding />
414
+ </state>
415
+ </provider>
416
+ </entry>
417
+ <entry file="file://$APPLICATION_HOME_DIR$/rubystubs193/hash.rb">
418
+ <provider selected="true" editor-type-id="text-editor">
419
+ <state line="251" column="8" selection-start="9755" selection-end="9755" vertical-scroll-proportion="0.84179103" />
420
+ </provider>
421
+ </entry>
422
+ <entry file="file://$PROJECT_DIR$/Gemfile">
423
+ <provider selected="true" editor-type-id="text-editor">
424
+ <state line="10" column="33" selection-start="152" selection-end="152" vertical-scroll-proportion="0.5671642" />
425
+ </provider>
426
+ </entry>
427
+ <entry file="file://$USER_HOME$/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/forwardable.rb">
428
+ <provider selected="true" editor-type-id="text-editor">
429
+ <state line="169" column="6" selection-start="4623" selection-end="4623" vertical-scroll-proportion="4.16641" />
430
+ </provider>
431
+ </entry>
432
+ <entry file="file://$USER_HOME$/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/logger.rb">
433
+ <provider selected="true" editor-type-id="text-editor">
434
+ <state line="432" column="6" selection-start="12994" selection-end="12994" vertical-scroll-proportion="-0.6257485" />
435
+ </provider>
436
+ </entry>
437
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/sidereel_client.rb">
438
+ <provider selected="true" editor-type-id="text-editor">
439
+ <state line="13" column="43" selection-start="427" selection-end="427" vertical-scroll-proportion="0.6227545">
440
+ <folding />
441
+ </state>
442
+ </provider>
443
+ </entry>
444
+ <entry file="file://$PROJECT_DIR$/bin/my_shows">
445
+ <provider selected="true" editor-type-id="text-editor">
446
+ <state line="10" column="40" selection-start="208" selection-end="208" vertical-scroll-proportion="0.4790419" />
447
+ </provider>
448
+ </entry>
449
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/logger.rb">
450
+ <provider selected="true" editor-type-id="text-editor">
451
+ <state line="4" column="11" selection-start="62" selection-end="62" vertical-scroll-proportion="0.19161677">
452
+ <folding />
453
+ </state>
454
+ </provider>
455
+ </entry>
456
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/the_pirate_bay_client.rb">
457
+ <provider selected="true" editor-type-id="text-editor">
458
+ <state line="4" column="6" selection-start="72" selection-end="72" vertical-scroll-proportion="0.09495549">
459
+ <folding />
460
+ </state>
461
+ </provider>
462
+ </entry>
463
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/auth.rb">
464
+ <provider selected="true" editor-type-id="text-editor">
465
+ <state line="29" column="8" selection-start="426" selection-end="426" vertical-scroll-proportion="0.0">
466
+ <folding />
467
+ </state>
468
+ </provider>
469
+ </entry>
470
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/episode.rb">
471
+ <provider selected="true" editor-type-id="text-editor">
472
+ <state line="17" column="25" selection-start="457" selection-end="457" vertical-scroll-proportion="0.10835215">
473
+ <folding />
474
+ </state>
475
+ </provider>
476
+ </entry>
477
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/show.rb">
478
+ <provider selected="true" editor-type-id="text-editor">
479
+ <state line="5" column="11" selection-start="94" selection-end="94" vertical-scroll-proportion="0.1805869">
480
+ <folding />
481
+ </state>
482
+ </provider>
483
+ </entry>
484
+ <entry file="file://$PROJECT_DIR$/lib/my_shows/version.rb">
485
+ <provider selected="true" editor-type-id="text-editor">
486
+ <state line="1" column="3" selection-start="18" selection-end="18" vertical-scroll-proportion="0.023738872">
487
+ <folding />
488
+ </state>
489
+ </provider>
490
+ </entry>
491
+ <entry file="file://$PROJECT_DIR$/lib/my_shows.rb">
492
+ <provider selected="true" editor-type-id="text-editor">
493
+ <state line="64" column="29" selection-start="1380" selection-end="1380" vertical-scroll-proportion="0.9074492">
494
+ <folding />
495
+ </state>
496
+ </provider>
497
+ </entry>
498
+ </component>
499
+ </project>
500
+
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.3
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'awesome_print'
7
+ gem 'rake'
8
+ end
9
+
10
+ group :test do
11
+ gem 'rspec-core'
12
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Paul Nikitochkin
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # MyShows
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'my_shows'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install my_shows
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
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/my_shows ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'my_shows'
4
+
5
+ # Output message to $stderr, prefixed with the program name
6
+ def pute(message="")
7
+ $stderr.puts "#{$0}: #{message}"
8
+ end
9
+
10
+ begin
11
+ MyShows.logger.level = ::Logger::FATAL
12
+
13
+ MyShows::CLI.start(ARGV)
14
+ rescue Interrupt
15
+ pute "Quitting..."
16
+ exit 1
17
+ end
@@ -0,0 +1,90 @@
1
+ module MyShows
2
+ module Auth
3
+ def ask
4
+ $stdin.gets.to_s.strip
5
+ end
6
+
7
+ def with_tty(&block)
8
+ return unless $stdin.isatty
9
+ yield
10
+ rescue
11
+ logger.warn 'with_tty faild'
12
+ end
13
+
14
+ def echo_off
15
+ with_tty do
16
+ system "stty -echo"
17
+ end
18
+ end
19
+
20
+ def echo_on
21
+ with_tty do
22
+ system "stty echo"
23
+ end
24
+ end
25
+
26
+ def netrc
27
+ @netrc ||= Netrc.read
28
+ end
29
+
30
+ def credentials
31
+ @credentials ||= (read_credentials || ask_for_and_save_credentials)
32
+ end
33
+
34
+ def read_credentials
35
+ netrc[host]
36
+ end
37
+
38
+ def ask_for_and_save_credentials
39
+ begin
40
+ @credentials = ask_for_credentials
41
+ write_credentials
42
+ check
43
+ rescue Exception => e
44
+ delete_credentials
45
+ raise e
46
+ end
47
+ @credentials
48
+ end
49
+
50
+ def delete_credentials
51
+ netrc.delete(host)
52
+ netrc.save
53
+ @credentials = nil
54
+ end
55
+
56
+ def write_credentials
57
+ netrc[host] = self.credentials
58
+ netrc.save
59
+ end
60
+
61
+ def ask_for_credentials
62
+ puts "Enter your Heroku credentials."
63
+
64
+ print "Email: "
65
+ user = ask
66
+
67
+ print "Password (typing will be hidden): "
68
+ password = ask_for_password
69
+
70
+ [user, password]
71
+ end
72
+
73
+ def ask_for_password
74
+ echo_off
75
+ password = ask
76
+ puts
77
+ echo_on
78
+ return password
79
+ end
80
+
81
+ def host
82
+ 'sidereel.com'
83
+ end
84
+
85
+ def check
86
+ client = SidereelClient.new *self.credentials
87
+ client.tracked_tv_shows
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,36 @@
1
+ require 'my_shows/the_pirate_bay_client'
2
+
3
+ module MyShows
4
+ class Episode
5
+ @@jarow = FuzzyStringMatch::JaroWinkler.create(:native)
6
+ @@tracker = ThePirateBayClient.new
7
+
8
+ attr_accessor :season, :episode, :show, :magnet_link
9
+
10
+ def initialize(attributes = {})
11
+ attributes.each do |name, value|
12
+ send("#{name}=", value)
13
+ end
14
+ end
15
+
16
+ def torrent_link!
17
+ episode_search_query = "#{self.to_s} PublicHD"
18
+ MyShows.logger.info "Looking for '#{episode_search_query}' ..."
19
+
20
+ begin
21
+ torrents = @@tracker.search(episode_search_query)
22
+ torrent = torrents.sort_by { |t| @@jarow.getDistance(episode_search_query, t.name) }.reverse.first
23
+
24
+ self.magnet_link = torrent && torrent.magnet_link
25
+ rescue => e
26
+ MyShows.logger.warn "Problem with looking torrent link"
27
+ MyShows.logger.debug e.message
28
+ nil
29
+ end
30
+ end
31
+
32
+ def to_s
33
+ "%s s%02de%02d" % [show.name, season, episode]
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,7 @@
1
+ require 'logger'
2
+
3
+ module MyShows
4
+ def self.logger
5
+ @logger ||= ::Logger.new(STDOUT)
6
+ end
7
+ end
@@ -0,0 +1,29 @@
1
+ require 'hashie'
2
+ require 'hashie/mash'
3
+
4
+ module MyShows
5
+ class Show < Hashie::Mash
6
+ def self.client
7
+ @client ||= SidereelClient.new ENV["SIDEREEL_USERNAME"], ENV["SIDEREEL_PASSWORD"]
8
+ end
9
+
10
+ def self.client= client
11
+ @client = client
12
+ end
13
+
14
+ def initialize *attrs
15
+ super
16
+ attrs.last[:episode].show = self if attrs.last && attrs.last[:episode]
17
+ end
18
+
19
+ def self.next_episodes
20
+ client.tracked_tv_shows.first[1].map(&:tv_show).reject do |show|
21
+ MyShows.logger.debug "TV Show data: #{show.inspect}"
22
+ show.next_episode.nil? || show.next_episode.is_upcoming
23
+ end.map do |show|
24
+ episode = MyShows::Episode.new(season: show.next_episode.season_number, episode: show.next_episode.season_ordinal)
25
+ Show.new name: show.complete_name, episode: episode
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,25 @@
1
+ require 'faraday_middleware'
2
+
3
+ class SidereelClient < Struct.new(:username, :password)
4
+ def connection
5
+ MyShows.logger.info "Create connection for #{username}"
6
+
7
+ @connection ||= Faraday.new url: 'http://www.sidereel.com' do |conn|
8
+ conn.request :url_encoded # form-encode POST params
9
+ conn.request :basic_auth, username, password
10
+ conn.request :json
11
+
12
+ conn.response :mashify
13
+ conn.response :json
14
+
15
+ conn.response :logger, MyShows.logger
16
+
17
+ conn.adapter Faraday.default_adapter
18
+ end
19
+ end
20
+
21
+ def tracked_tv_shows
22
+ response = connection.get '/users/tracked_tv_shows'
23
+ @shows ||= response.body
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ require 'faraday_middleware'
2
+ require 'nokogiri'
3
+ require 'hashie'
4
+
5
+ class ThePirateBayClient
6
+ def connection
7
+ @connection ||= Faraday.new url: 'http://thepiratebay.se' do |conn|
8
+ conn.headers[:user_agent] = 'libcurl-agent/1.0'
9
+ conn.request :url_encoded
10
+ conn.response :logger, MyShows.logger
11
+ conn.adapter Faraday.default_adapter
12
+ end
13
+ end
14
+
15
+ def search query
16
+ response = connection.get URI.escape("/search/#{query}/0/99/200")
17
+ Nokogiri::HTML(response.body).css('#searchResult > tr td:nth-child(2)').map do |row|
18
+ Hashie::Mash.new(name: row.at_css('.detName a').content, magnet_link: row.at_css('a[href^=magnet]')['href'])
19
+ end
20
+ end
21
+ end
22
+
23
+ if __FILE__ == $0
24
+ p ThePirateBayClient.new.search('mike and molly')
25
+ end
@@ -0,0 +1,3 @@
1
+ module MyShows
2
+ VERSION = "0.0.1"
3
+ end
data/lib/my_shows.rb ADDED
@@ -0,0 +1,76 @@
1
+ #!ruby19
2
+ # encoding: utf-8
3
+
4
+ require 'my_shows/version'
5
+
6
+ require "bundler/setup"
7
+
8
+ require 'netrc'
9
+ require 'fuzzystringmatch'
10
+ require 'colorize'
11
+
12
+ require 'my_shows/logger'
13
+ require 'my_shows/auth'
14
+ require 'my_shows/sidereel_client'
15
+ require 'my_shows/show'
16
+ require 'my_shows/episode'
17
+
18
+ module MyShows
19
+ class CLI
20
+ class <<self
21
+ include MyShows::Auth
22
+
23
+ def logger
24
+ MyShows.logger
25
+ end
26
+
27
+ def configure_client
28
+ MyShows::Show.client = SidereelClient.new(*self.credentials)
29
+ end
30
+
31
+ def lookup_magnet_links shows
32
+ shows.map { |show|
33
+ show.episode.torrent_link!
34
+ }.compact
35
+ end
36
+
37
+ def enque_to_download links
38
+ links.each do |link|
39
+ logger.debug "Enque #{link}"
40
+ `open '#{link}'`
41
+ end
42
+ end
43
+
44
+ def start *args
45
+ print_header
46
+ configure_client
47
+ shows = Show.next_episodes
48
+ links = lookup_magnet_links(shows)
49
+ print_episodes shows
50
+ enque_to_download links
51
+ print_footer
52
+ end
53
+
54
+ def print_header
55
+ puts "MyShows #{MyShows::VERSION}".colorize(:light_white)
56
+ end
57
+
58
+ def print_episodes episodes
59
+ puts "Next episodes:"
60
+ episodes.each do |show|
61
+ episode = show.episode
62
+ puts "#{episode} [#{episode.magnet_link ? '✓'.colorize(:green) : '✗'.colorize(:red)}]"
63
+ end
64
+ end
65
+
66
+ def print_footer
67
+ puts 'Bye!'
68
+ end
69
+ end
70
+ end
71
+ end
72
+
73
+ if __FILE__ == $0
74
+ MyShows.logger.level = ::Logger::FATAL
75
+ MyShows::CLI.start
76
+ end
data/my_shows.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'my_shows/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "my_shows"
8
+ gem.version = MyShows::VERSION
9
+ gem.authors = ["Paul Nikitochkin"]
10
+ gem.email = ["pftg@jetthoughts.com"]
11
+ gem.description = %q{My Shows get list of next episodes from Sidereel.com, find torrent links and enque them to download}
12
+ gem.summary = %q{New TV Show Episodes downloader}
13
+ gem.homepage = "http://github.com/pftg/my_shows"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.executables = %w(my_shows)
21
+ gem.default_executable = 'my_shows'
22
+ gem.add_dependency('hashie', '~> 1.2.0')
23
+ gem.add_dependency('faraday_middleware', '~> 0.9.0')
24
+ gem.add_dependency('fuzzy-string-match', '~> 0.9.4')
25
+ gem.add_dependency('netrc', '~> 0.7.7')
26
+ gem.add_dependency('nokogiri')
27
+ gem.add_dependency('colorize')
28
+ end
metadata ADDED
@@ -0,0 +1,174 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: my_shows
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Paul Nikitochkin
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: hashie
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.2.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 1.2.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: faraday_middleware
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.9.0
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.9.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: fuzzy-string-match
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.9.4
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.9.4
62
+ - !ruby/object:Gem::Dependency
63
+ name: netrc
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.7.7
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.7.7
78
+ - !ruby/object:Gem::Dependency
79
+ name: nokogiri
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: colorize
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ description: My Shows get list of next episodes from Sidereel.com, find torrent links
111
+ and enque them to download
112
+ email:
113
+ - pftg@jetthoughts.com
114
+ executables:
115
+ - my_shows
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - .gitignore
120
+ - .idea/.name
121
+ - .idea/.rakeTasks
122
+ - .idea/encodings.xml
123
+ - .idea/misc.xml
124
+ - .idea/modules.xml
125
+ - .idea/my_shows.iml
126
+ - .idea/scopes/scope_settings.xml
127
+ - .idea/vcs.xml
128
+ - .idea/workspace.xml
129
+ - .rvmrc
130
+ - Gemfile
131
+ - LICENSE.txt
132
+ - README.md
133
+ - Rakefile
134
+ - bin/my_shows
135
+ - lib/my_shows.rb
136
+ - lib/my_shows/auth.rb
137
+ - lib/my_shows/episode.rb
138
+ - lib/my_shows/logger.rb
139
+ - lib/my_shows/show.rb
140
+ - lib/my_shows/sidereel_client.rb
141
+ - lib/my_shows/the_pirate_bay_client.rb
142
+ - lib/my_shows/version.rb
143
+ - my_shows.gemspec
144
+ homepage: http://github.com/pftg/my_shows
145
+ licenses: []
146
+ post_install_message:
147
+ rdoc_options: []
148
+ require_paths:
149
+ - lib
150
+ required_ruby_version: !ruby/object:Gem::Requirement
151
+ none: false
152
+ requirements:
153
+ - - ! '>='
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ segments:
157
+ - 0
158
+ hash: -1910858514683235095
159
+ required_rubygems_version: !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ segments:
166
+ - 0
167
+ hash: -1910858514683235095
168
+ requirements: []
169
+ rubyforge_project:
170
+ rubygems_version: 1.8.25
171
+ signing_key:
172
+ specification_version: 3
173
+ summary: New TV Show Episodes downloader
174
+ test_files: []