Permalink
Browse files

A large scale structural change to the source tree to take advantage

of the newgem project structure, which massively simplifies the Rakefile.

Change the license from LGPL to MIT to be more in line with other ruby
libraries.
  • Loading branch information...
1 parent adbf8a8 commit f15fcaa5b57295d3e15aaf7ad4a07be90da7005d @sdague sdague committed Mar 6, 2010
View
@@ -0,0 +1,4 @@
+=== 1.0.0 2010-03-06
+
+* 1 major enhancement:
+ * Conversion to newgem package for easier future maintenance
View
@@ -0,0 +1,29 @@
+History.txt
+LICENSE
+Manifest.txt
+PostInstall.txt
+README
+README.rdoc
+Rakefile
+account.yaml.example
+config/website.yml
+config/website.yml.sample
+docs/PDP_API_R1_11.pdf
+examples/test-fan-off.rb
+examples/test-fan-on.rb
+examples/test-run.rb
+examples/test-set-heat.rb
+lib/pdp/constants.rb
+lib/pdp/oid.rb
+lib/thermostat.rb
+script/console
+script/destroy
+script/generate
+script/txt2html
+test/test_helper.rb
+test/test_thermostat.rb
+website/index.html
+website/index.txt
+website/javascripts/rounded_corners_lite.inc.js
+website/stylesheets/screen.css
+website/template.html.erb
View
@@ -0,0 +1,5 @@
+
+For more information on thermostat.rb, see http://sdaguegems.rubyforge.org/thermostat
+
+
+
View
36 README
@@ -1,36 +0,0 @@
-Copyright (c) 2008 - Sean Dague <sean at dague dot net>
-
-THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-This code is based on the Proliphix Software API which can be found
-here ( http://www.proliphix.com/Documentation.aspx ). I am writing
-this software to interface with my NT20e unit. The API looks to be
-the same across all their IP units, but I will only be testing on my
-unit in my house.
-
-Important notices from the manual:
-
-**Limitations on the Frequency of Operations**
-
-While the device can handle numerous back to back requests, it is
-advisable to not sustain an operation frequency higher than 1 request
-per 60 second period for a substantial amount of time. In other words,
-sustained polling of the device should not exceed a few requests per
-minute. A prolonged burst of requests higher than 1 request per 60
-second period may degrade the main function of the thermostat. Also,
-if one is making a PIB set and wishes to observe a reaction from the
-device, it is advisable to wait for at least 1 second between the set
-request and subsequent get request.
-
-
View
@@ -0,0 +1,66 @@
+= thermostat
+
+* http://github.com/#{github_username}/#{project_name}
+
+== DESCRIPTION:
+
+Thermostat.rb is an attempt to build an easy to use ruby api around
+the web services provided by the Proliphix line of network
+thermostats. Their API is documented at
+http://www.proliphix.com/Documentation.aspx.
+
+The code is tested on the NT20e unit, which is what I own. It should
+react that same across all their network accessible units.
+
+== FEATURES/PROBLEMS:
+
+Note: It wrote the base module over a year ago, and am now starting to more actively use it in a new project, so interfaces may change to make the api easier to use.
+
+Important notices from the manual:
+
+**Limitations on the Frequency of Operations**
+
+While the device can handle numerous back to back requests, it is
+advisable to not sustain an operation frequency higher than 1 request
+per 60 second period for a substantial amount of time. In other words,
+sustained polling of the device should not exceed a few requests per
+minute. A prolonged burst of requests higher than 1 request per 60
+second period may degrade the main function of the thermostat. Also,
+if one is making a PIB set and wishes to observe a reaction from the
+device, it is advisable to wait for at least 1 second between the set
+request and subsequent get request.
+
+== SYNOPSIS:
+
+ FIX (code sample of usage)
+
+== REQUIREMENTS:
+
+== INSTALL:
+
+sudo gem install thermostat
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2010 Sean Dague
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,24 +1,26 @@
-require 'rake'
-require 'rake/gempackagetask'
-require 'fileutils'
-include FileUtils
-
-spec = Gem::Specification.new do |s|
- s.name = "thermostat"
- s.version = "0.0.2"
- s.author = "Sean Dague"
- s.email = "sean at dague dot net"
- s.homepage = "http://rubyforge.net/projects/rtc"
- s.platform = Gem::Platform::RUBY
- s.summary = "Ruby modules to control Prolipix IP Thermostats"
- s.files = FileList["{bin,lib}/**/*"].to_a
- s.require_path = "lib"
- s.autorequire = "thermostat"
- s.has_rdoc = true
- s.extra_rdoc_files = ["README"]
-end
-
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.need_tar = false
-end
-
+require 'rubygems'
+gem 'hoe', '>= 2.1.0'
+require 'hoe'
+require 'fileutils'
+require './lib/thermostat'
+
+Hoe.plugin :newgem
+Hoe.plugin :website
+# Hoe.plugin :cucumberfeatures
+
+# Generate all the Rake tasks
+# Run 'rake -T' to see list of generated tasks (from gem root directory)
+$hoe = Hoe.spec 'thermostat' do
+ self.developer 'Sean Dague', 'sean@dague.net'
+ self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
+ self.rubyforge_name = "sdaguegems" # TODO this is default value
+ # self.extra_deps = [['activesupport','>= 2.0.2']]
+
+end
+
+require 'newgem/tasks'
+Dir['tasks/**/*.rake'].each { |t| load t }
+
+# TODO - want other tests/tasks run by default? Add them to the list
+# remove_task :default
+# task :default => [:spec, :features]
View
@@ -0,0 +1,2 @@
+host: sdague@rubyforge.org
+remote_dir: /var/www/gforge-projects/sdaguegems/thermostat
@@ -1,12 +1,12 @@
#!/usr/bin/ruby
-$LOAD_PATH.unshift "lib"
+$LOAD_PATH.unshift "../lib"
require "yaml"
require 'thermostat'
include Proliphix
-c = YAML.load_file("account.yaml")
+c = YAML.load_file("../account.yaml")
t = Thermostat.new(c["ip"], c["user"], c["passwd"])
@@ -1,13 +1,13 @@
#!/usr/bin/ruby
-$LOAD_PATH.unshift "lib"
+$LOAD_PATH.unshift "../lib"
require "yaml"
require 'thermostat'
include Proliphix
-c = YAML.load_file("account.yaml")
+c = YAML.load_file("../account.yaml")
t = Thermostat.new(c["ip"], c["user"], c["passwd"])
@@ -1,13 +1,13 @@
#!/usr/bin/ruby
-$LOAD_PATH.unshift "lib"
+$LOAD_PATH.unshift "../lib"
require "yaml"
require 'thermostat'
include Proliphix
-c = YAML.load_file("account.yaml")
+c = YAML.load_file("../account.yaml")
t = Thermostat.new(c["ip"], c["user"], c["passwd"])
@@ -1,12 +1,12 @@
#!/usr/bin/ruby
-$LOAD_PATH.unshift "lib"
+$LOAD_PATH.unshift "../lib"
+require "yaml"
require 'thermostat'
-require 'pdp_constants'
include Proliphix
-c = YAML.load_file("account.yaml")
+c = YAML.load_file("../account.yaml")
t = Thermostat.new(c["ip"], c["user"], c["passwd"])
@@ -15,5 +15,6 @@
puts t
+# Sets the heat to 68.0 F
t.set_data(ThermSetbackHeat, 680)
View
@@ -1,3 +1,6 @@
+$:.unshift(File.dirname(__FILE__)) unless
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
+
require 'net/http'
require 'uri'
require 'open-uri'
@@ -8,7 +11,8 @@
# Some docs
class Thermostat
-
+ VERSION = '1.0'
+
def initialize(ip, user, passwd)
@ip = ip
@user = user
@@ -1,19 +0,0 @@
-Gem::Specification.new do |s|
- s.name = "thermostat"
- s.version = "0.0.2"
- s.author = "Sean Dague"
- s.email = "sean at dague dot net"
- s.homepage = "http://rubyforge.net/projects/rtc"
- s.platform = Gem::Platform::RUBY
- s.summary = "Ruby modules to control Prolipix IP Thermostats"
- s.files = [
- "lib/thermostat.rb",
- "lib/pdp",
- "lib/pdp/constants.rb",
- "lib/pdp/oid.rb"
- ]
- s.require_path = "lib"
- s.autorequire = "thermostat"
- s.has_rdoc = true
- s.extra_rdoc_files = ["README"]
-end
View
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+# File: script/console
+irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
+
+libs = " -r irb/completion"
+# Perhaps use a console_lib to store any extra methods I may want available in the cosole
+# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
+libs << " -r #{File.dirname(__FILE__) + '/../lib/thermostat.rb'}"
+puts "Loading thermostat gem"
+exec "#{irb} #{libs} --simple-prompt"
View
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+
+begin
+ require 'rubigen'
+rescue LoadError
+ require 'rubygems'
+ require 'rubigen'
+end
+require 'rubigen/scripts/destroy'
+
+ARGV.shift if ['--help', '-h'].include?(ARGV[0])
+RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
+RubiGen::Scripts::Destroy.new.run(ARGV)
View
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+
+begin
+ require 'rubigen'
+rescue LoadError
+ require 'rubygems'
+ require 'rubigen'
+end
+require 'rubigen/scripts/generate'
+
+ARGV.shift if ['--help', '-h'].include?(ARGV[0])
+RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
+RubiGen::Scripts::Generate.new.run(ARGV)
Oops, something went wrong.

0 comments on commit f15fcaa

Please sign in to comment.