christ 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7c942743b2f08200a2519f438f75c5fc76d5152
4
- data.tar.gz: 94f75ddfd067766dc171f8ab08bf100a46ce871b
3
+ metadata.gz: 17572e3baa87a085f1fb34f6ff1e40df08ec7f72
4
+ data.tar.gz: c91f4dcc068c1ff2e5402a6083a3690f27f821b9
5
5
  SHA512:
6
- metadata.gz: 0ced5daa4af40197113644112634c79744dff67aa5d7749a4810c32f5e6ff3ef686dbcadec8d8d7ef18c6af344113ac8f9f81cb2493ee83f079f3e0bb44fde63
7
- data.tar.gz: 24618888f249743b866fda41686916352d881fc590a98d5fd703b3e23786804181a267b3dbd77779edee59fe016ce76a1c43827676953d64cbdd14087c3d12c5
6
+ metadata.gz: 732d587e30eb4d47dab7ac811b7a783f0f6ab6dbd0b5535c3fb506b10a55cca916588393c9cfd35197b121c5ec6e875d905f21d681c3457f8a371005ad201aa0
7
+ data.tar.gz: 857044a6fe76dea9c130a3d5376f59b6360ca33efdd9559430efb720397e35f5ad6cf24742f2a301ca522bf68ca8bc8cdda4515881f831b680b4e7075a80647d
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Christ
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/christ`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Pipe any output on the CLI and Christ will create a private GIST for it.
4
+
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
6
 
7
7
  ## Installation
8
8
 
@@ -22,21 +22,17 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- Set your Git oauth token as a environmnet variable.
26
-
27
- Learn to here:
25
+ Pipe any output to christ
26
+ ```
27
+ ifconfig | christ
28
+ ```
29
+ To create a gist tied to your github:
28
30
  https://help.github.com/articles/creating-an-access-token-for-command-line-use/
29
31
 
30
- It only needs Gist access
31
-
32
32
  ```
33
33
  export OCTOKIT_ACCESS_TOKEN='000000000000'
34
34
  ```
35
35
 
36
- then you pipe andy out put like so:
37
-
38
- date | christ
39
-
40
36
  ## Development
41
37
 
42
38
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
data/christ.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.bindir = "exe"
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
27
-
27
+ spec.add_runtime_dependency 'octokit'
28
28
  spec.add_development_dependency "bundler", "~> 1.9"
29
29
  spec.add_development_dependency "rake", "~> 10.0"
30
30
  end
data/exe/christ CHANGED
@@ -4,4 +4,4 @@ require 'christ'
4
4
 
5
5
  gist = Christ::Gist.new
6
6
 
7
- gist.create_gist
7
+ gist.initialization
@@ -1,3 +1,3 @@
1
1
  module Christ
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/christ.rb CHANGED
@@ -2,13 +2,22 @@ require "christ/version"
2
2
  require "octokit"
3
3
  module Christ
4
4
  class Gist
5
- def create_gist
6
- client = Octokit::Client.new
7
- input = {ARGF.filename => {content: ARGF.read}}
8
- array = []
9
- array.push(input)
10
- url = client.create_gist({files: input})
11
- puts "👼" + " " + url[:html_url]
5
+ def initialization
6
+ file_content = ARGF.read
7
+ file_name = ARGF.filename
8
+ url = gist_url(file_content, file_name)
9
+ puts "👼" + " " + url
12
10
  end
11
+
12
+ def github_connect
13
+ Octokit::Client.new
14
+ end
15
+
16
+ def gist_url(file_content, file_name)
17
+ content = Hash[file_name => Hash[content: file_content]]
18
+ url = github_connect.create_gist({files: content})
19
+ return url[:html_url]
20
+ end
21
+
13
22
  end
14
23
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: christ
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shannon Dunn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-28 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: octokit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement