mrhyde 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
6
+ *.gem
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Keith Hanson
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,23 @@
1
+ = Mr. Hyde
2
+
3
+ Mr. Hyde aims to be a simple yet powerful comment system for Jekyll-based blogs, and aims to provide:
4
+
5
+ * Methods for generating the site via Github hooks
6
+ * Providing Comment functionality
7
+ * More to come!
8
+
9
+ == Getting Started
10
+ Coming soon!
11
+
12
+ == Note on Patches/Pull Requests
13
+
14
+ * Fork the project.
15
+ * Make your feature addition or bug fix.
16
+ * Add tests for it. This is important so I don't break it in a
17
+ future version unintentionally.
18
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
19
+ * Send me a pull request. Bonus points for topic branches.
20
+
21
+ == Copyright
22
+
23
+ Copyright (c) 2009 Keith Hanson. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,53 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "mrhyde"
8
+ gem.summary = %Q{Mr. Hyde aims to be a simple yet powerful comment system for Jekyll-based blogs}
9
+ gem.description = %Q{Mr. Hyde is a companion to Jekyll, the blog-aware, static site generator in Ruby. It provides methods of generating the site via github hooks, providing commenting functions, as well as various other niceties.}
10
+ gem.email = "keith@rubyengineer.com[color]"
11
+ gem.homepage = "http://github.com/KeithHanson/mrhyde"
12
+ gem.authors = ["Keith Hanson"]
13
+ gem.add_development_dependency "rspec"
14
+ gem.add_dependency('sinatra', '>= 0.9.2')
15
+ gem.add_dependency('haml', '>= 2.2.2')
16
+ gem.add_dependency('ohm', '>= 0.0.25')
17
+ gem.add_dependency('evri_rpx', '>= 1.0.0')
18
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
+ end
20
+ Jeweler::GemcutterTasks.new
21
+ rescue LoadError
22
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
23
+ end
24
+
25
+ require 'spec/rake/spectask'
26
+ Spec::Rake::SpecTask.new(:spec) do |spec|
27
+ spec.libs << 'lib' << 'spec'
28
+ spec.spec_files = FileList['spec/**/*_spec.rb']
29
+ end
30
+
31
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
32
+ spec.libs << 'lib' << 'spec'
33
+ spec.pattern = 'spec/**/*_spec.rb'
34
+ spec.rcov = true
35
+ end
36
+
37
+ task :spec => :check_dependencies
38
+
39
+ task :default => :spec
40
+
41
+ require 'rake/rdoctask'
42
+ Rake::RDocTask.new do |rdoc|
43
+ if File.exist?('VERSION')
44
+ version = File.read('VERSION')
45
+ else
46
+ version = ""
47
+ end
48
+
49
+ rdoc.rdoc_dir = 'rdoc'
50
+ rdoc.title = "mrhyde #{version}"
51
+ rdoc.rdoc_files.include('README*')
52
+ rdoc.rdoc_files.include('lib/**/*.rb')
53
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
data/bin/mrhyde ADDED
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
4
+
5
+ help = <<HELP
6
+ Mr. Hyde is a companion application for Jekyll
7
+ HELP
8
+
9
+ require 'optparse'
10
+ require 'mrhyde'
11
+
12
+ options = {}
13
+
14
+ opts = OptionParser.new do |opts|
15
+ opts.banner = help
16
+
17
+ opts.on("--server [PORT]", "Start web server (default port 4000)") do |port|
18
+ options['server'] = true
19
+ options['server_port'] = port unless port.nil?
20
+ end
21
+
22
+ opts.on("--daemon", "Runs the webserver in daemon mode") do
23
+ options['daemon'] = true
24
+ end
25
+
26
+ opts.on("--disable-github", "Disables github hooks") do
27
+ options['github'] = false
28
+ end
29
+
30
+ opts.on("--set-rpx-key KEY", "Sets the configuration file's RPX key") do |key|
31
+ options['rpx_key'] = key
32
+ end
33
+
34
+ opts.on("--set-admin USER", "Sets the configuration file's admin user") do |user|
35
+ options['admin'] = user
36
+ end
37
+
38
+ opts.on("--rackup [DIR]", "Generates the rackup file") do |directory|
39
+ options['rackup'] = true
40
+ options['rackup_directory'] = directory unless directory.nil?
41
+ end
42
+
43
+ opts.on("--start-redis [PORT]", "Starts the required redis server") do |port|
44
+ options['redis'] = true
45
+ options['redis_port'] = port unless port.nil?
46
+ end
47
+
48
+ opts.on("--generate-default [DIR]", "Generates default site structure") do |directory|
49
+ options['generate'] = true
50
+ options['generate_directory'] = directory unless directory.nil?
51
+ end
52
+ end
53
+
54
+ opts.parse!
55
+
56
+ if options.keys.empty?
57
+ puts "Run `mrhyde --help` for options"
58
+ exit(1)
59
+ end
60
+
61
+ options['github'] = true unless options['github']
data/lib/mrhyde.rb ADDED
@@ -0,0 +1,29 @@
1
+ ROOT_DIR = File.expand_path(File.dirname(__FILE__)) unless defined? ROOT_DIR
2
+
3
+ require 'rubygems'
4
+ require 'haml'
5
+ require 'sinatra/base'
6
+ require 'ohm'
7
+ require 'evri_rpx'
8
+
9
+ class Main < Sinatra::Base
10
+ enable :dump_errors, :logging, :static
11
+
12
+ set :app_file, __FILE__
13
+ set :root, File.join(ROOT_DIR, "mrhyde")
14
+ set :run, true
15
+ use Rack::Session::Cookie
16
+ # set :port, 80
17
+ set :blog_name, "YOUR BLOG NAME HERE"
18
+ set :rpx_url, "https://mrhyde.rpxnow.com/openid/v2/signin?token_url=http://rubyengineer.com/rpx_token_url"
19
+
20
+ def self.rpx
21
+ debugger
22
+ @@rpx ||= Evri::RPX::Session.new(YOUR_API_KEY_HERE)
23
+ end
24
+
25
+ end
26
+
27
+ require File.join(ROOT_DIR, "mrhyde", "main.rb")
28
+
29
+ Main.run! if Main.run?
data/lib/mrhyde.ru ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ require "mrhyde"
3
+
4
+ Main.set :run, false
5
+ Main.set :environment, :production
6
+
7
+ Main.set :rpx_key, "YOUR_RPX_KEY"
8
+
9
+ run Main
File without changes
@@ -0,0 +1,31 @@
1
+ require 'ruby-debug'
2
+
3
+ class Main
4
+ helpers do
5
+ def authenticated?
6
+ !session[:user].nil?
7
+ end
8
+ end
9
+
10
+ get '/' do
11
+ haml :index
12
+ end
13
+
14
+ get '/login' do
15
+ haml :login
16
+ end
17
+
18
+ post '/rpx_token_url' do
19
+ @user = Main.rpx.auth_info(params['token'])
20
+ #...
21
+ end
22
+
23
+ get '/:post_slug' do |post_slug|
24
+
25
+ end
26
+
27
+ post '/:post_slug/comment' do |post_slug|
28
+ redirect "/login" unless authenticated?
29
+ end
30
+
31
+ end
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title
5
+ Comments for
6
+ = options.blog_name
7
+ %body
8
+ =yield
9
+ %script{:type => "text/javascript", :src => "https://rpxnow.com/openid/v2/widget"}=""
10
+ :javascript
11
+ RPXNOW.overlay = true;
12
+ RPXNOW.language_preference = 'en';
@@ -0,0 +1 @@
1
+ %a.rpxnow{:href => options.rpx_url, :onclick => "return false;"} Sign In!
data/mrhyde.gemspec ADDED
@@ -0,0 +1,75 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{mrhyde}
8
+ s.version = "0.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Keith Hanson"]
12
+ s.date = %q{2009-10-16}
13
+ s.default_executable = %q{mrhyde}
14
+ s.description = %q{Mr. Hyde is a companion to Jekyll, the blog-aware, static site generator in Ruby. It provides methods of generating the site via github hooks, providing commenting functions, as well as various other niceties.}
15
+ s.email = %q{keith@rubyengineer.com[color]}
16
+ s.executables = ["mrhyde"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".gitignore",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/mrhyde",
29
+ "lib/mrhyde.rb",
30
+ "lib/mrhyde.ru",
31
+ "lib/mrhyde/database/.gitignore",
32
+ "lib/mrhyde/main.rb",
33
+ "lib/mrhyde/public/.gitignore",
34
+ "lib/mrhyde/views/index.haml",
35
+ "lib/mrhyde/views/layout.haml",
36
+ "lib/mrhyde/views/login.haml",
37
+ "mrhyde.gemspec",
38
+ "spec/mrhyde_spec.rb",
39
+ "spec/spec_helper.rb"
40
+ ]
41
+ s.homepage = %q{http://github.com/KeithHanson/mrhyde}
42
+ s.rdoc_options = ["--charset=UTF-8"]
43
+ s.require_paths = ["lib"]
44
+ s.rubygems_version = %q{1.3.5}
45
+ s.summary = %q{Mr. Hyde aims to be a simple yet powerful comment system for Jekyll-based blogs}
46
+ s.test_files = [
47
+ "spec/mrhyde_spec.rb",
48
+ "spec/spec_helper.rb"
49
+ ]
50
+
51
+ if s.respond_to? :specification_version then
52
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
53
+ s.specification_version = 3
54
+
55
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
56
+ s.add_development_dependency(%q<rspec>, [">= 0"])
57
+ s.add_runtime_dependency(%q<sinatra>, [">= 0.9.2"])
58
+ s.add_runtime_dependency(%q<haml>, [">= 2.2.2"])
59
+ s.add_runtime_dependency(%q<ohm>, [">= 0.0.25"])
60
+ s.add_runtime_dependency(%q<evri_rpx>, [">= 1.0.0"])
61
+ else
62
+ s.add_dependency(%q<rspec>, [">= 0"])
63
+ s.add_dependency(%q<sinatra>, [">= 0.9.2"])
64
+ s.add_dependency(%q<haml>, [">= 2.2.2"])
65
+ s.add_dependency(%q<ohm>, [">= 0.0.25"])
66
+ s.add_dependency(%q<evri_rpx>, [">= 1.0.0"])
67
+ end
68
+ else
69
+ s.add_dependency(%q<rspec>, [">= 0"])
70
+ s.add_dependency(%q<sinatra>, [">= 0.9.2"])
71
+ s.add_dependency(%q<haml>, [">= 2.2.2"])
72
+ s.add_dependency(%q<ohm>, [">= 0.0.25"])
73
+ s.add_dependency(%q<evri_rpx>, [">= 1.0.0"])
74
+ end
75
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Mrhyde" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'mrhyde'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mrhyde
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Keith Hanson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-16 00:00:00 -05:00
13
+ default_executable: mrhyde
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: sinatra
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.9.2
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: haml
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.2.2
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: ohm
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 0.0.25
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: evri_rpx
57
+ type: :runtime
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 1.0.0
64
+ version:
65
+ description: Mr. Hyde is a companion to Jekyll, the blog-aware, static site generator in Ruby. It provides methods of generating the site via github hooks, providing commenting functions, as well as various other niceties.
66
+ email: keith@rubyengineer.com[color]
67
+ executables:
68
+ - mrhyde
69
+ extensions: []
70
+
71
+ extra_rdoc_files:
72
+ - LICENSE
73
+ - README.rdoc
74
+ files:
75
+ - .document
76
+ - .gitignore
77
+ - LICENSE
78
+ - README.rdoc
79
+ - Rakefile
80
+ - VERSION
81
+ - bin/mrhyde
82
+ - lib/mrhyde.rb
83
+ - lib/mrhyde.ru
84
+ - lib/mrhyde/database/.gitignore
85
+ - lib/mrhyde/main.rb
86
+ - lib/mrhyde/public/.gitignore
87
+ - lib/mrhyde/views/index.haml
88
+ - lib/mrhyde/views/layout.haml
89
+ - lib/mrhyde/views/login.haml
90
+ - mrhyde.gemspec
91
+ - spec/mrhyde_spec.rb
92
+ - spec/spec_helper.rb
93
+ has_rdoc: true
94
+ homepage: http://github.com/KeithHanson/mrhyde
95
+ licenses: []
96
+
97
+ post_install_message:
98
+ rdoc_options:
99
+ - --charset=UTF-8
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: "0"
107
+ version:
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: "0"
113
+ version:
114
+ requirements: []
115
+
116
+ rubyforge_project:
117
+ rubygems_version: 1.3.5
118
+ signing_key:
119
+ specification_version: 3
120
+ summary: Mr. Hyde aims to be a simple yet powerful comment system for Jekyll-based blogs
121
+ test_files:
122
+ - spec/mrhyde_spec.rb
123
+ - spec/spec_helper.rb