copybar 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/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'json', :platforms => :mri_18
7
+ gem "debugger", :platforms => :mri_19
8
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,27 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ copybar (0.0.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ columnize (0.3.6)
10
+ debugger (1.2.0)
11
+ columnize (>= 0.3.1)
12
+ debugger-linecache (~> 1.1.1)
13
+ debugger-ruby_core_source (~> 1.1.3)
14
+ debugger-linecache (1.1.2)
15
+ debugger-ruby_core_source (>= 1.1.1)
16
+ debugger-ruby_core_source (1.1.3)
17
+ json (1.6.4)
18
+ rake (0.9.2.2)
19
+
20
+ PLATFORMS
21
+ ruby
22
+
23
+ DEPENDENCIES
24
+ copybar!
25
+ debugger
26
+ json
27
+ rake
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Incflow
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.md ADDED
@@ -0,0 +1,72 @@
1
+ # Copybar
2
+
3
+ Copybar is a Content Management as a service platform that provides the easiest way to edit/manage your content within any Ruby or Rails web app.
4
+
5
+ No account is needed to start. Just pick a unique username and start using it immediately.
6
+
7
+ **<http://copybar.io>**
8
+
9
+ ## Features
10
+
11
+ * inline editor
12
+ * pick up and go. no account or setup needed. just start using it.
13
+ * create dynamic elements on the fly when you need them (just by using the path)
14
+ * full REST api for managing content
15
+ * fast, cdn backed
16
+ * collaboration tools
17
+
18
+ ## Compatibility
19
+
20
+ * Rails 3.x
21
+ * Padrino
22
+ * Sinatra
23
+ * Any Ruby
24
+
25
+ ## Installing on Rails 3
26
+
27
+ Add this to your `Gemfile`:
28
+
29
+ ```ruby
30
+ gem "copybar"
31
+ ```
32
+
33
+ ## Installing on Sinatra/Padrino
34
+
35
+ Add this to your `Gemfile`:
36
+
37
+ ```ruby
38
+ gem "copybar"
39
+ ```
40
+
41
+ in your app.rb, you'll also need to register RailsConfig
42
+
43
+ ```ruby
44
+ register Copybar
45
+ ```
46
+
47
+ ## Direct access to your Copybar data
48
+
49
+ After installing this plugin, the `Copybar` object will be available globally that you use to pull data from your server.
50
+
51
+
52
+ ```ruby
53
+ Copybar("account-name", "path/to/element")
54
+ ```
55
+
56
+ ## View Helper
57
+
58
+ ```erb
59
+ <%= Copybar("account-name", "path/to/element") %>
60
+ ```
61
+
62
+ ## Options for helper
63
+
64
+ You can also manually include the editor tools when pulling your element.
65
+
66
+ ```ruby
67
+ Copybar("account-name", "path/to/element", :edit => true)
68
+ ```
69
+
70
+ ## Authors
71
+
72
+ * [Copybar](http://github.com/copybar)
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+
4
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
5
+ require "copybar/version"
6
+
7
+ desc 'Default: run specs.'
8
+ task :default => :spec
9
+
10
+ task :gem => :build
11
+ task :build do
12
+ system "gem build copybar.gemspec"
13
+ end
14
+
15
+ task :install => :build do
16
+ system "gem install copybar-#{Copybar::VERSION}.gem"
17
+ end
18
+
19
+ task :release => :build do
20
+ system "git tag -a v#{Copybar::VERSION} -m 'Tagging #{Copybar::VERSION}'"
21
+ system "git push --tags"
22
+ system "gem push copybar-#{Copybar::VERSION}.gem"
23
+ end
data/copybar.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ require File.dirname(__FILE__) + "/lib/copybar/version"
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "copybar"
5
+ s.version = Copybar::VERSION
6
+ s.date = Date.today.to_s
7
+ s.authors = ["Marc Cantwell"]
8
+ s.email = ["marc.a.cantwell@gmail.com"]
9
+ s.summary = "Integrates any Ruby / Rails / Sinatra web app with Copybar (content management as a service)"
10
+ s.description = "Integrates any Ruby / Rails / Sinatra web app with Copybar (content management as a service) "
11
+ s.homepage = "http://github.com/copybar/gem"
12
+ s.extra_rdoc_files = ["README.md"]
13
+ s.rdoc_options = ["--charset=UTF-8"]
14
+ s.require_paths = ["lib"]
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = []
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+
19
+ s.add_development_dependency "rake"
20
+ end
21
+
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require File.dirname(__FILE__) + '/lib/copybar'
data/lib/copybar.rb ADDED
@@ -0,0 +1,28 @@
1
+ require 'copybar/version'
2
+ require 'open-uri'
3
+
4
+ module Copybar
5
+ COPYBAR_HOST = "copybar.io"
6
+
7
+ def self.build_uri(username, element_path, options = {})
8
+ query_string = "?edit=true" if options[:edit]
9
+
10
+ "http://#{COPYBAR_HOST}/#{username}/#{element_path}#{query_string}"
11
+ end
12
+
13
+ def self.read(username, element_path, options = {})
14
+ html = open(build_uri(username, element_path, options)).read
15
+
16
+ # return html safe string
17
+ if html.respond_to?(:html_safe)
18
+ html.html_safe
19
+ else
20
+ html
21
+ end
22
+ end
23
+ end
24
+
25
+ # provide root module helper method
26
+ def Copybar(username, element_path, options = {})
27
+ Copybar.read(username, element_path, options)
28
+ end
@@ -0,0 +1,3 @@
1
+ module Copybar
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: copybar
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Marc Cantwell
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-10-17 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: ! 'Integrates any Ruby / Rails / Sinatra web app with Copybar (content
31
+ management as a service) '
32
+ email:
33
+ - marc.a.cantwell@gmail.com
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files:
37
+ - README.md
38
+ files:
39
+ - Gemfile
40
+ - Gemfile.lock
41
+ - LICENSE
42
+ - README.md
43
+ - Rakefile
44
+ - copybar-0.0.1.gem
45
+ - copybar.gemspec
46
+ - init.rb
47
+ - lib/copybar.rb
48
+ - lib/copybar/version.rb
49
+ homepage: http://github.com/copybar/gem
50
+ licenses: []
51
+ post_install_message:
52
+ rdoc_options:
53
+ - --charset=UTF-8
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubyforge_project:
70
+ rubygems_version: 1.8.19
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: Integrates any Ruby / Rails / Sinatra web app with Copybar (content management
74
+ as a service)
75
+ test_files: []