simple_pvr 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +1 -4
  5. data/Gemfile.lock +72 -61
  6. data/README.md +51 -33
  7. data/bin/pvr_server +14 -6
  8. data/changelog.txt +11 -0
  9. data/development_server +14 -6
  10. data/features/channel_overview.feature +1 -1
  11. data/features/recordings.feature +30 -0
  12. data/features/step_definitions/pvr_steps.rb +34 -0
  13. data/features/support/env.rb +1 -2
  14. data/features/support/paths.rb +2 -0
  15. data/lib/simple_pvr.rb +2 -0
  16. data/lib/simple_pvr/model/database_initializer.rb +8 -0
  17. data/lib/simple_pvr/model/programme.rb +12 -2
  18. data/lib/simple_pvr/model/programme_actor.rb +14 -0
  19. data/lib/simple_pvr/model/programme_category.rb +14 -0
  20. data/lib/simple_pvr/model/programme_director.rb +13 -0
  21. data/lib/simple_pvr/model/programme_presenter.rb +13 -0
  22. data/lib/simple_pvr/model/recording.rb +12 -0
  23. data/lib/simple_pvr/programme_icon_fetcher.rb +15 -0
  24. data/lib/simple_pvr/pvr_initializer.rb +4 -4
  25. data/lib/simple_pvr/recorder.rb +4 -3
  26. data/lib/simple_pvr/recording_manager.rb +44 -24
  27. data/lib/simple_pvr/recording_planner.rb +3 -3
  28. data/lib/simple_pvr/scheduler.rb +12 -4
  29. data/lib/simple_pvr/server/base_controller.rb +12 -13
  30. data/lib/simple_pvr/server/channels_controller.rb +5 -5
  31. data/lib/simple_pvr/server/programmes_controller.rb +2 -2
  32. data/lib/simple_pvr/server/schedules_controller.rb +4 -4
  33. data/lib/simple_pvr/server/secured_controller.rb +71 -0
  34. data/lib/simple_pvr/server/shows_controller.rb +13 -8
  35. data/lib/simple_pvr/server/status_controller.rb +1 -1
  36. data/lib/simple_pvr/server/upcoming_recordings_controller.rb +1 -1
  37. data/lib/simple_pvr/version.rb +1 -1
  38. data/lib/simple_pvr/xmltv_reader.rb +37 -4
  39. data/public/css/typeahead.js-bootstrap.css +83 -0
  40. data/public/index.html +45 -37
  41. data/public/js/angular/http-auth-interceptor.js +122 -0
  42. data/public/js/app.js +4 -37
  43. data/public/js/controllers.js +22 -14
  44. data/public/js/directives.js +102 -0
  45. data/public/js/filters.js +0 -31
  46. data/public/js/services.js +64 -0
  47. data/public/js/typeahead/typeahead.min.js +7 -0
  48. data/public/partials/about.html +15 -13
  49. data/public/partials/channels.html +41 -36
  50. data/public/partials/programme.html +20 -4
  51. data/public/partials/programmeListing.html +14 -13
  52. data/public/partials/schedule.html +91 -86
  53. data/public/partials/schedules.html +28 -16
  54. data/public/partials/search.html +10 -11
  55. data/public/partials/show.html +26 -9
  56. data/public/partials/shows.html +5 -6
  57. data/public/partials/status.html +1 -1
  58. data/public/templates/loginDialog.html +30 -0
  59. data/public/templates/logoutLink.html +1 -0
  60. data/public/templates/titleSearch.html +5 -3
  61. data/simple_pvr.gemspec +6 -4
  62. data/spec/resources/dummyImage.png +1 -0
  63. data/spec/resources/programmes-with-categories.xmltv +27 -0
  64. data/spec/resources/programmes-with-credits.xmltv +24 -0
  65. data/spec/resources/programmes-with-icons.xmltv +25 -0
  66. data/spec/resources/programmes-with-presenters.xmltv +19 -0
  67. data/spec/resources/{programs-without-icon.xmltv → programmes-without-icon.xmltv} +0 -0
  68. data/spec/resources/{programs.xmltv → programmes.xmltv} +0 -4
  69. data/spec/simple_pvr/ffmpeg_spec.rb +24 -22
  70. data/spec/simple_pvr/hdhomerun_spec.rb +69 -67
  71. data/spec/simple_pvr/model/channel_spec.rb +101 -101
  72. data/spec/simple_pvr/model/programme_spec.rb +104 -104
  73. data/spec/simple_pvr/model/schedule_spec.rb +74 -74
  74. data/spec/simple_pvr/programme_icon_fetcher_spec.rb +25 -0
  75. data/spec/simple_pvr/pvr_initializer_spec.rb +40 -38
  76. data/spec/simple_pvr/recorder_spec.rb +37 -26
  77. data/spec/simple_pvr/recording_manager_spec.rb +160 -133
  78. data/spec/simple_pvr/recording_planner_spec.rb +213 -211
  79. data/spec/simple_pvr/scheduler_spec.rb +189 -172
  80. data/spec/simple_pvr/server/secured_controller_spec.rb +118 -0
  81. data/spec/simple_pvr/xmltv_reader_spec.rb +89 -41
  82. data/test/karma.conf.js +7 -4
  83. data/test/unit/filtersSpec.js +0 -36
  84. metadata +79 -63
  85. data/public/css/bootstrap-responsive.min.css +0 -9
  86. data/public/css/bootstrap.min.css +0 -9
  87. data/public/img/glyphicons-halflings-white.png +0 -0
  88. data/public/img/glyphicons-halflings.png +0 -0
  89. data/public/js/angular/angular-resource.min.js +0 -10
  90. data/public/js/angular/angular.min.js +0 -162
  91. data/public/js/bootstrap/bootstrap.min.js +0 -6
  92. data/public/js/jquery/jquery.min.js +0 -5
  93. data/test/lib/angular/angular-mocks.js +0 -1768
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 84772c897136fb2024af2906037ff0d6792af853
4
+ data.tar.gz: 4f10984bc033e0fdb86228cd7f61481087927129
5
+ SHA512:
6
+ metadata.gz: ebc54083f8e67bac789cf45b67037ad8fef92f23b86036a936b037803f0155c5fce2bc10d13b1525572eba4988f3aae71cd7827f00b2b659a55b5e88b465a964
7
+ data.tar.gz: 19bf485868ef7a76cf4d26c9fbc46240fb458a0445e886e732c83f58568a0cda2d3bd3ff3f84256d8f8ec762ba0f494a16a6bf0c514166d00312f8fae5ea3b80
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  .DS_Store
2
2
  /channels.txt
3
+ /server.*
3
4
  channel_mappings.yaml
4
5
  *.sqlite
5
6
  tvgrabbed.xmltv
@@ -0,0 +1 @@
1
+ 2.0.0
@@ -1,6 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- before_install:
5
- - "export DISPLAY=:99.0"
6
- - "sh -e /etc/init.d/xvfb start"
3
+ - 2.0.0
@@ -1,37 +1,39 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_pvr (1.0.0)
4
+ simple_pvr (1.1.0)
5
5
  activesupport (~> 3.2)
6
6
  data_mapper (~> 1.2)
7
7
  dm-sqlite-adapter (~> 1.2)
8
8
  nokogiri (~> 1.5)
9
- puma (~> 1.6)
9
+ puma (~> 2.7)
10
10
  sinatra (~> 1.3)
11
11
 
12
12
  GEM
13
13
  remote: http://rubygems.org/
14
14
  specs:
15
- activesupport (3.2.12)
16
- i18n (~> 0.6)
15
+ activesupport (3.2.16)
16
+ i18n (~> 0.6, >= 0.6.4)
17
17
  multi_json (~> 1.0)
18
- addressable (2.2.8)
19
- bcrypt-ruby (3.0.1)
20
- builder (3.1.0)
21
- capybara (2.0.3)
18
+ addressable (2.3.5)
19
+ bcrypt-ruby (3.1.2)
20
+ builder (3.2.2)
21
+ capybara (2.2.0)
22
22
  mime-types (>= 1.16)
23
23
  nokogiri (>= 1.3.3)
24
24
  rack (>= 1.0.0)
25
25
  rack-test (>= 0.5.4)
26
- selenium-webdriver (~> 2.0)
27
- xpath (~> 1.0.0)
26
+ xpath (~> 2.0)
28
27
  childprocess (0.3.9)
29
28
  ffi (~> 1.0, >= 1.0.11)
30
- cucumber (1.2.1)
29
+ cliver (0.3.2)
30
+ coderay (1.1.0)
31
+ cucumber (1.3.10)
31
32
  builder (>= 2.1.2)
32
33
  diff-lcs (>= 1.1.3)
33
- gherkin (~> 2.11.0)
34
- json (>= 1.4.6)
34
+ gherkin (~> 2.12)
35
+ multi_json (>= 1.7.5, < 2.0)
36
+ multi_test (>= 0.0.2)
35
37
  data_mapper (1.2.0)
36
38
  dm-aggregates (~> 1.2.0)
37
39
  dm-constraints (~> 1.2.0)
@@ -42,15 +44,15 @@ GEM
42
44
  dm-transactions (~> 1.2.0)
43
45
  dm-types (~> 1.2.0)
44
46
  dm-validations (~> 1.2.0)
45
- data_objects (0.10.12)
47
+ data_objects (0.10.13)
46
48
  addressable (~> 2.1)
47
- diff-lcs (1.1.3)
49
+ diff-lcs (1.2.5)
48
50
  dm-aggregates (1.2.0)
49
51
  dm-core (~> 1.2.0)
50
52
  dm-constraints (1.2.0)
51
53
  dm-core (~> 1.2.0)
52
- dm-core (1.2.0)
53
- addressable (~> 2.2.6)
54
+ dm-core (1.2.1)
55
+ addressable (~> 2.3)
54
56
  dm-do-adapter (1.2.0)
55
57
  data_objects (~> 0.10.6)
56
58
  dm-core (~> 1.2.0)
@@ -79,66 +81,75 @@ GEM
79
81
  uuidtools (~> 2.1)
80
82
  dm-validations (1.2.0)
81
83
  dm-core (~> 1.2.0)
82
- do_sqlite3 (0.10.12)
83
- data_objects (= 0.10.12)
84
- eventmachine (1.0.3)
84
+ do_sqlite3 (0.10.13)
85
+ data_objects (= 0.10.13)
85
86
  fastercsv (1.5.5)
86
- faye-websocket (0.4.7)
87
- eventmachine (>= 0.12.0)
88
- ffi (1.6.0)
89
- gherkin (2.11.2)
90
- json (>= 1.4.6)
91
- http_parser.rb (0.5.3)
92
- i18n (0.6.4)
93
- json (1.7.5)
94
- json_pure (1.7.7)
95
- mime-types (1.21)
96
- multi_json (1.3.6)
97
- nokogiri (1.5.5)
98
- poltergeist (1.1.0)
99
- capybara (~> 2.0, >= 2.0.1)
100
- faye-websocket (~> 0.4, >= 0.4.4)
101
- http_parser.rb (~> 0.5.3)
102
- puma (1.6.3)
103
- rack (~> 1.2)
104
- rack (1.4.1)
105
- rack-protection (1.5.0)
87
+ ffi (1.9.3)
88
+ gherkin (2.12.2)
89
+ multi_json (~> 1.3)
90
+ i18n (0.6.9)
91
+ json (1.8.1)
92
+ json_pure (1.8.1)
93
+ method_source (0.8.2)
94
+ mime-types (2.0)
95
+ mini_portile (0.5.2)
96
+ multi_json (1.8.2)
97
+ multi_test (0.0.2)
98
+ nokogiri (1.6.0)
99
+ mini_portile (~> 0.5.0)
100
+ poltergeist (1.5.0)
101
+ capybara (~> 2.1)
102
+ cliver (~> 0.3.1)
103
+ multi_json (~> 1.0)
104
+ websocket-driver (>= 0.2.0)
105
+ pry (0.9.12.4)
106
+ coderay (~> 1.0)
107
+ method_source (~> 0.8)
108
+ slop (~> 3.4)
109
+ puma (2.7.1)
110
+ rack (>= 1.1, < 2.0)
111
+ rack (1.5.2)
112
+ rack-protection (1.5.1)
106
113
  rack
107
114
  rack-test (0.6.2)
108
115
  rack (>= 1.0)
109
- rake (10.0.3)
110
- rspec (2.11.0)
111
- rspec-core (~> 2.11.0)
112
- rspec-expectations (~> 2.11.0)
113
- rspec-mocks (~> 2.11.0)
114
- rspec-core (2.11.1)
115
- rspec-expectations (2.11.3)
116
- diff-lcs (~> 1.1.3)
117
- rspec-mocks (2.11.2)
118
- rubyzip (0.9.9)
119
- selenium-webdriver (2.31.0)
116
+ rake (10.1.0)
117
+ rspec (2.14.1)
118
+ rspec-core (~> 2.14.0)
119
+ rspec-expectations (~> 2.14.0)
120
+ rspec-mocks (~> 2.14.0)
121
+ rspec-core (2.14.7)
122
+ rspec-expectations (2.14.4)
123
+ diff-lcs (>= 1.1.3, < 2.0)
124
+ rspec-mocks (2.14.4)
125
+ rubyzip (1.1.0)
126
+ selenium-webdriver (2.38.0)
120
127
  childprocess (>= 0.2.5)
121
128
  multi_json (~> 1.0)
122
- rubyzip
129
+ rubyzip (~> 1.0)
123
130
  websocket (~> 1.0.4)
124
- sinatra (1.3.6)
131
+ sinatra (1.4.4)
125
132
  rack (~> 1.4)
126
- rack-protection (~> 1.3)
127
- tilt (~> 1.3, >= 1.3.3)
133
+ rack-protection (~> 1.4)
134
+ tilt (~> 1.3, >= 1.3.4)
135
+ slop (3.4.7)
128
136
  stringex (1.5.1)
129
- tilt (1.3.5)
130
- uuidtools (2.1.3)
137
+ tilt (1.4.1)
138
+ uuidtools (2.1.4)
131
139
  websocket (1.0.7)
132
- xpath (1.0.0)
140
+ websocket-driver (0.3.1)
141
+ xpath (2.0.0)
133
142
  nokogiri (~> 1.3)
134
143
 
135
144
  PLATFORMS
136
145
  ruby
137
146
 
138
147
  DEPENDENCIES
139
- capybara (~> 2.0)
140
- cucumber (~> 1.2)
141
- poltergeist (~> 1.1)
148
+ capybara (~> 2.2)
149
+ cucumber (~> 1.3)
150
+ poltergeist (~> 1.5)
151
+ pry
142
152
  rake (>= 10.0.0)
143
153
  rspec (~> 2.11)
154
+ selenium-webdriver
144
155
  simple_pvr!
data/README.md CHANGED
@@ -2,19 +2,22 @@ SimplePVR-Ruby-backend
2
2
  ======================
3
3
  A really, really simple PVR (Personal Video Recorder) system which only supports the
4
4
  [HDHomeRun network tuners](http://www.silicondust.com/). It's written in Ruby and is highly hackable. If
5
- you don't want to hack it, but just want a solid PVR system, no worries: It's dead-simple to use.
5
+ you don't want to hack it, but just want a solid PVR, no worries: It's dead-simple to use.
6
6
 
7
- SimplePVR does not contain its own player, but currently provides an XBMC plug-in and some half-hearted
8
- browser playback. Apart from that, all recordings are stored in a simple directory structure (see below
9
- for an explanation), so that you can just point your favorite player to the recordings.
7
+ SimplePVR does not contain its own player, but currently provides an XBMC plug-in. Apart from that, all
8
+ recordings are stored in a simple directory structure (see below for an explanation), so that you can just
9
+ point your favorite player to the recordings.
10
+
11
+ Wanna see what it looks like? [Take a look at the Wiki.](https://github.com/olefriis/simplepvr-backend-ruby/wiki)
10
12
 
11
13
  Why?
12
14
  ====
13
- MythTV stopped working for me and my HDHomeRun box in the 0.25 release. And even though MythTV has loads
14
- of merits, I just have no idea what to do when it stops working - I am not in control of my media center.
15
+ MythTV stopped working for me and my HDHomeRun box in the 0.25 release. Even though MythTV has loads
16
+ of merits, I just have no idea what to do when it stops working. I was not in control of my media center.
15
17
 
16
18
  During the last couple of years, I have spent a substantial amount of time on bugs that suddenly appeared
17
- in MythTV and suddenly went away. I really don't like using systems this brittle.
19
+ in MythTV and suddenly went away. I really don't like using systems this brittle. My wife got frustrated
20
+ too, which is unfortunate as well...
18
21
 
19
22
  So I wanted to create a really simple PVR in Ruby, making it possible for others to hack away and have
20
23
  fun while recording TV shows for the rest of the family.
@@ -30,13 +33,13 @@ Installation
30
33
  First of all, you need a computer and an HDHomeRun tuner box. On your computer, you need to have the
31
34
  "hdhomerun_config" tool on the path.
32
35
 
33
- You need Ruby 1.9.2 or newer (1.9.0 or newer is probably enough).
36
+ You need Ruby 2.0.0 or newer. When that's in place, simply run this from the command line:
34
37
 
35
38
  gem install simple_pvr
36
39
 
37
40
  It might not always be completely straightforward... simple_pvr uses DataMapper, which in turn relies on
38
41
  bcrypt-ruby, which compiles some native stuff. So on MacOS, you need to install XCode and its command-line
39
- utilities, or get "make" in some other way. On Linux, it should just work. Don't know about Windows.
42
+ utilities, or get "make" in some other way. On Linux, it should just work. There's no Windows support.
40
43
 
41
44
  If you'd like thumbnails for the recorded shows and ability to transcode recordings to WebM (so you can view
42
45
  them directly in your browser), you need FFMPEG on the command-line. Install it using MacPorts, Homebrew,
@@ -53,7 +56,16 @@ URL to the outside world, you'd better supply a username and password:
53
56
 
54
57
  username=me password=secret pvr_server
55
58
 
56
- This will secure the application with Basic HTTP Authentication.
59
+ This will secure the application with Basic HTTP Authentication. However, everything is sent in clear text. If
60
+ you're worried about your PVR data, you should create an SSL certificate (see
61
+ [https://devcenter.heroku.com/articles/ssl-certificate-self](this description), for example) and supply the key
62
+ and certificate paths when starting the server:
63
+
64
+ username=me password=secret key=server.key cert=server.crt pvr_server
65
+
66
+ You can also supply the `port` variable, in case you want to expose the server on another port than 4567:
67
+
68
+ username=me password=secret key=server.key cert=server.crt port=8443 pvr_server
57
69
 
58
70
  XMLTV
59
71
  =====
@@ -76,21 +88,26 @@ Or, if you've secured your web server with Basic HTTP Authentication like I told
76
88
 
77
89
  curl -d "" -u me:secret localhost:4567/api/schedules/reload
78
90
 
91
+ If you've been really good and enabled HTTPS, you should specify that (here we're also running on port 8443, and
92
+ we've disabled curl's SSL validation, since we're running with a self-signed certificate...):
93
+
94
+ curl -d "" -u me:secret --insecure https://localhost:8443/api/schedules/reload
95
+
79
96
  Recordings
80
97
  ==========
81
98
  The recordings are laid out like this, from the directory where you ran pvr_server:
82
99
 
83
100
  * recordings/
84
101
  * Borgias/
85
- * 1/
86
- * 2/
102
+ * 1331214600/
103
+ * 1333893000/
87
104
  * Sports news/
88
- * 1/
89
- * 2/
90
- * 3/
105
+ * 1331387400/
106
+ * 1331473800/
107
+ * 1331560200/
91
108
  * ...
92
109
 
93
- Inside the numbered directories are these files:
110
+ The numbers on the directories are simply time stamps. Inside these numbered directories are these files:
94
111
 
95
112
  * stream.ts: The actual stream. Let VLC or another media player show these for you.
96
113
  * hdhomerun_save.log: The output from the actual recording command.
@@ -100,18 +117,16 @@ Inside the numbered directories are these files:
100
117
 
101
118
  XBMC Plug-In
102
119
  ============
103
- There's a very simple XBMC plug-in for SimplePVR. See [the home page](https://github.com/olefriis/simplepvr)
104
- for more information.
120
+ There's a simple XBMC plug-in for SimplePVR which enables you to easily watch your recordings, see
121
+ metadata, and delete watched recordings. See
122
+ [the home page](https://github.com/olefriis/simplepvr-frontend-xbmc) for more information.
105
123
 
106
124
  Future?
107
125
  =======
108
126
  This projects needs to be a nice, readable, hackable, tested system. No pull requests are
109
127
  accepted that violate this.
110
128
 
111
- For version 1 of SimplePVR, there are no more features planned. I'll see if the current incarnation seems
112
- stable in the long run on my own setup, and if so, I'll mark it as 1.0.0.
113
-
114
- There is lots of stuff I'd like to do after that, but I have no deadline - which means that pull
129
+ There is lots of stuff I'd like to do, but I have no deadline - which means that pull
115
130
  requests are the only means you have for speeding things up. This includes:
116
131
 
117
132
  * Web interface:
@@ -128,7 +143,6 @@ requests are the only means you have for speeding things up. This includes:
128
143
  * XMLTV import:
129
144
  * Let SimplePVR itself fetch XMLTV URLs at specified times of day.
130
145
  * Set-up of matching XMLTV IDs to channels could make good use of a GUI.
131
- * Parse and make use of programme icons etc.
132
146
  * Searching for tuners and scanning for channels would be nice through the web GUI.
133
147
  * Saving with the hdhomerun_config command is done through a shell script, so we can shut it down properly. I'd
134
148
  like a simpler solution, but haven't found anything that works both on OS X and Linux.
@@ -138,18 +152,22 @@ Some features would be cool to have, but I don't have a personal need for them,
138
152
  happen if *you* implement them and send me a pull request. Besides, some of them I have no clue how
139
153
  to implement...
140
154
 
141
- * Some kind of live TV.
142
- * Create metadata for XBMC and Serviio.
143
- * Duplication detection.
155
+ * A logo!
156
+ * Some kind of live TV through an XBMC PVR plug-in.
157
+ * Plug-ins for other media systems than XBMC.
144
158
  * Commercial detection.
159
+ * Intelligent planning of recordings, taking into account re-runs etc.
145
160
  * Record multiple programmes on same multiplex, so we are not restricted to only recording two
146
161
  programmes at once.
162
+ * More complete XMLTV parser.
163
+ * Windows support.
164
+ * Support for other tuners than HDHomeRun.
147
165
 
148
166
  Development
149
167
  ===========
150
168
  You need the following installed:
151
169
 
152
- * Ruby 1.9.3 or newer.
170
+ * Ruby 2.0 or newer.
153
171
  * [Bundler](http://gembundler.com/).
154
172
  * [Karma](http://karma-runner.github.com/0.8/index.html).
155
173
  * [PhantomJS](http://phantomjs.org/) - and the phantomjs executable must be on your path.
@@ -172,13 +190,12 @@ If you want to keep Karma running and let it execute whenever a file changes, ru
172
190
 
173
191
  karma start test/karma.conf.js
174
192
 
175
- The specs currently use Selenium to drive Firefox, but you can choose to use PhantomJS instead:
176
-
177
- capybara_driver=poltergeist rake test:features
193
+ The specs currently use Poltergeist to drive PhantomJS, but you can let Selenium drive Firefox instead:
178
194
 
179
- This currently doesn't work for all specs, though. (Again, if you can fix it, please send a pull request!)
195
+ capybara_driver=selenium rake test:features
180
196
 
181
- To create the gem, make sure that lib/simple_pvr/version.rb is up-to-date, commit everything and run:
197
+ To create the gem, make sure that lib/simple_pvr/version.rb and changelog.txt are up-to-date, commit
198
+ everything and run:
182
199
 
183
200
  rake build
184
201
 
@@ -189,4 +206,5 @@ the automatic tests, right?), and execute
189
206
 
190
207
  ...which will release the gem to rubygems.org.
191
208
 
192
- I'm trying to make Travis CI like SimplePVR, but it's not easy: [![Build Status](https://travis-ci.org/olefriis/simplepvr-backend-ruby.png)](https://travis-ci.org/olefriis/simplepvr-backend-ruby)
209
+ I'm trying to make Travis CI like SimplePVR, but it's not easy... tests run fine on my own and several
210
+ other machines, but fail on Travis: [![Build Status](https://travis-ci.org/olefriis/simplepvr-backend-ruby.png)](https://travis-ci.org/olefriis/simplepvr-backend-ruby)
@@ -1,10 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rack'
3
+ require 'puma/cli'
4
4
  require 'simple_pvr'
5
5
 
6
- Rack::Server.start(
7
- :config => SimplePvr::PvrInitializer.rackup_file_path,
8
- :Port => 4567,
9
- :server => 'puma'
10
- )
6
+ port = ENV['port'] || 4567
7
+ key = ENV['key']
8
+ cert = ENV['cert']
9
+ use_ssl = key && cert
10
+
11
+ if use_ssl
12
+ bind_url = "ssl://0.0.0.0:#{port}?key=#{key}&cert=#{cert}"
13
+ else
14
+ puts 'Consider setting up SSL by specifying key and cert. Please consult the documentation.'
15
+ bind_url = "tcp://0.0.0.0:#{port}"
16
+ end
17
+
18
+ Puma::CLI.new([SimplePvr::PvrInitializer.rackup_file_path, '--bind', bind_url]).run
@@ -0,0 +1,11 @@
1
+ 1.1.0
2
+ - Proper log-in dialog, instead of the browser's own HTTP Basic Authentication dialog.
3
+ - Updated to Twitter Bootstrap 3 (and newer versions of other JS libraries).
4
+ - Using CDNs for most of the JavaScript, reducing the size of the gem.
5
+ - Possibility to run server in HTTPS.
6
+ - More extensive use of XMLTV data: categories, actors, directors, images, etc.
7
+ - Recording subdirectories now use timestamps as names instead of a sequence, since XBMC
8
+ would get a little bit confused with new recordings in old directories.
9
+
10
+ 1.0.0
11
+ - Initial release. Everything is working nicely.
@@ -1,10 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rack'
3
+ require 'puma/cli'
4
4
  require File.dirname(__FILE__) + '/lib/simple_pvr'
5
5
 
6
- Rack::Server.start(
7
- :config => SimplePvr::PvrInitializer.rackup_file_path,
8
- :Port => 4567,
9
- :server => 'puma'
10
- )
6
+ port = ENV['port'] || 4567
7
+ key = ENV['key']
8
+ cert = ENV['cert']
9
+ use_ssl = key && cert
10
+
11
+ if use_ssl
12
+ bind_url = "ssl://0.0.0.0:#{port}?key=#{key}&cert=#{cert}"
13
+ else
14
+ puts 'Consider setting up SSL by specifying key and cert. Please consult the documentation.'
15
+ bind_url = "tcp://0.0.0.0:#{port}"
16
+ end
17
+
18
+ Puma::CLI.new([SimplePvr::PvrInitializer.rackup_file_path, '--bind', bind_url]).run