safety-pin 0.1.0 → 0.1.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/README.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # SafetyPin
2
2
 
3
- TODO: Write a gem description
3
+ Interact with a [JCR Content Repository](http://jackrabbit.apache.org/jcr-api.html) using the Ruby code you love.
4
+
5
+ Originally made to turn long, manually node editing tasks into fast, script-able moments.
4
6
 
5
7
  ## Installation
6
8
 
9
+ **This gem requires [JRuby](http://jruby.org/) to run**
10
+
7
11
  Add this line to your application's Gemfile:
8
12
 
9
- gem 'safety_pin'
13
+ gem 'safety-pin'
10
14
 
11
15
  And then execute:
12
16
 
@@ -14,11 +18,44 @@ And then execute:
14
18
 
15
19
  Or install it yourself as:
16
20
 
17
- $ gem install safety_pin
21
+ $ gem install safety-pin
18
22
 
19
23
  ## Usage
20
24
 
21
- TODO: Write usage instructions here
25
+ You can interact with the JCR using Ruby code in ways you would expect:
26
+
27
+ ```ruby
28
+ require 'safety-pin'
29
+ include SafetyPin
30
+
31
+ node = Node.find("/content") # returns node at path
32
+ node.child("foo") # returns child by name
33
+ node.children # returns array of children
34
+
35
+ node.properties # returns hash of unprotected properties
36
+ node.properties = {"bar" => "baz"} # replaces unprotected properties
37
+
38
+ node["foo"] # returns value of property
39
+ node["foo"] = "bar" # assigns value to property
40
+
41
+ node.save # saves changes to session
42
+ node.refresh # reloads node from JCR
43
+ ```
44
+
45
+ ## Interactive Shell
46
+
47
+ You can open an IRB with SafetyPin included and connected to a JCR instance:
48
+
49
+ ```sh
50
+ $ rbenv global jruby-1.7.0-rc1 # make sure to use JRuby
51
+ $ gem install safety-pin
52
+ $ safety-pin -h http://localhost:4502
53
+ Username: # type username
54
+ Password: # type password
55
+ >> Node.find("/content")
56
+ => #<SafetyPin::Node:0x146ccf3e>
57
+ >> # type whatever
58
+ ```
22
59
 
23
60
  ## Contributing
24
61
 
@@ -1,5 +1,7 @@
1
1
  $: << File.dirname(__FILE__)
2
2
 
3
+ raise "Platform is #{RUBY_PLATFORM}, must be java. Please run using JRuby: http://jruby.org/" unless RUBY_PLATFORM == "java"
4
+
3
5
  require 'java'
4
6
  Dir.glob("**/*.jar").each {|jar| require jar }
5
7
  require 'safety_pin/jcr'
@@ -1,3 +1,3 @@
1
1
  module SafetyPin
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ["jnraine@gmail.com"]
7
7
  gem.description = %q{An easy-to-use JCR connector for JRuby}
8
8
  gem.summary = %q{JCR connector for JRuby}
9
- gem.homepage = ""
9
+ gem.homepage = "https://github.com/jnraine/safety-pin"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safety-pin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -137,7 +137,7 @@ files:
137
137
  - spec/query_spec.rb
138
138
  - spec/spec_helper.rb
139
139
  - spec/where_condition_spec.rb
140
- homepage: ''
140
+ homepage: https://github.com/jnraine/safety-pin
141
141
  licenses: []
142
142
  post_install_message:
143
143
  rdoc_options: []