infect 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock ADDED
@@ -0,0 +1,24 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ infect (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.1.3)
10
+ rspec (2.12.0)
11
+ rspec-core (~> 2.12.0)
12
+ rspec-expectations (~> 2.12.0)
13
+ rspec-mocks (~> 2.12.0)
14
+ rspec-core (2.12.2)
15
+ rspec-expectations (2.12.1)
16
+ diff-lcs (~> 1.1.3)
17
+ rspec-mocks (2.12.1)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ infect!
24
+ rspec
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ desc "Compile infect into a single file"
4
+ task :compile do
5
+ puts "yay"
6
+ end
data/infect.gemspec CHANGED
@@ -8,12 +8,13 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Infect::VERSION
9
9
  gem.authors = ["Christopher Sexton"]
10
10
  gem.email = ["csexton@gmail.com"]
11
- gem.description = %q{Bundle manager for pathogen.vim}
12
- gem.summary = %q{Asset Pipeline for Pathogen, install vim bundles based on comments in your vimrc}
13
- gem.homepage = ""
11
+ gem.description = %q{Asset Pipeline for Pathogen.vim}
12
+ gem.summary = %q{Asset Pipeline for Vim and Pathogen, install vim bundles included in your vimrc}
13
+ gem.homepage = "https://github.com/csexton/infect"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
+ gem.add_development_dependency('rspec')
19
20
  end
data/lib/infect.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'open-uri'
2
- require 'fileutils'
3
1
  lib = File.expand_path('..', __FILE__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'infect/version'
@@ -1,3 +1,6 @@
1
+ require 'open-uri'
2
+ require 'fileutils'
3
+
1
4
  module Infect
2
5
  class Command
3
6
  def self.build(command, args)
@@ -5,7 +8,7 @@ module Infect
5
8
  when :bundle
6
9
  Bundle.new(args)
7
10
  else
8
- puts "WARNING: #{command} is not a valid command, ignorning"
11
+ $stderr.puts "WARNING: #{command} is not a valid command, ignorning"
9
12
  end
10
13
  end
11
14
 
@@ -29,10 +32,6 @@ module Infect
29
32
  def colorize(code, str)
30
33
  "\e[#{code}m#{str}\e[0m"
31
34
  end
32
- #def red(str); colorize(31, str); end
33
- #def green(str); colorize(32, str); end
34
- #def yellow(str); colorize(33, str); end
35
-
36
35
  def notice(str)
37
36
  puts colorize(32, str)
38
37
  end
@@ -1,3 +1,3 @@
1
1
  module Infect
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,11 @@
1
+ require "./lib/infect"
2
+
3
+ describe Infect::Command do
4
+ it "build a nil class when given a bad command" do
5
+ Infect::Command.build("blargl", []).should be_nil
6
+ end
7
+
8
+ it "build a bundle command" do
9
+ Infect::Command.build("bundle", ["tpope/vim-pathogen"]).name.should == "vim-pathogen"
10
+ end
11
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: infect
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Christopher Sexton
@@ -10,8 +10,24 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-01-14 00:00:00.000000000 Z
13
- dependencies: []
14
- description: Bundle manager for pathogen.vim
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ none: false
21
+ name: rspec
22
+ type: :development
23
+ prerelease: false
24
+ requirement: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ! '>='
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ none: false
30
+ description: Asset Pipeline for Pathogen.vim
15
31
  email:
16
32
  - csexton@gmail.com
17
33
  executables:
@@ -22,17 +38,18 @@ files:
22
38
  - .gitignore
23
39
  - CONTRIBUTING.md
24
40
  - Gemfile
41
+ - Gemfile.lock
25
42
  - LICENSE.txt
26
43
  - README.md
27
44
  - Rakefile
28
45
  - bin/infect
29
46
  - infect.gemspec
30
- - lib/infect-org.rb
31
47
  - lib/infect.rb
32
48
  - lib/infect/command.rb
33
49
  - lib/infect/command/bundle.rb
34
50
  - lib/infect/version.rb
35
- homepage: ''
51
+ - spec/command_spec.rb
52
+ homepage: https://github.com/csexton/infect
36
53
  licenses: []
37
54
  post_install_message:
38
55
  rdoc_options: []
@@ -55,6 +72,7 @@ rubyforge_project:
55
72
  rubygems_version: 1.8.24
56
73
  signing_key:
57
74
  specification_version: 3
58
- summary: Asset Pipeline for Pathogen, install vim bundles based on comments in your
75
+ summary: Asset Pipeline for Vim and Pathogen, install vim bundles included in your
59
76
  vimrc
60
- test_files: []
77
+ test_files:
78
+ - spec/command_spec.rb
data/lib/infect-org.rb DELETED
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # Infect
4
- #
5
- # Asset Pipeline for Pathogen and Vim
6
- #
7
- require 'open-uri'
8
- require 'fileutils'
9
-
10
- class String
11
- def colorize(code); "\e[#{code}m#{self}\e[0m"; end
12
- def red; colorize(31); end
13
- def green; colorize(32); end
14
- def yellow; colorize(33); end
15
- end
16
-
17
- unless Dir.respond_to?(:home)
18
- class Dir
19
- class << self
20
- define_method :home do
21
- ENV['HOME']
22
- end
23
- end
24
- end
25
- end
26
-
27
-
28
- module Infect
29
- def self.run
30
- commands = []
31
-
32
- File.open( "#{ENV['HOME']}/.vimrc" ).each do |line|
33
- if line =~ /^"=/
34
- command, *args = line.split
35
- commands << Command.build(command.gsub('"=', ''), args)
36
- end
37
- end
38
-
39
- commands.compact.each do |command|
40
- command.call
41
- end
42
- end
43
- end
44
-
45
- if __FILE__ == $0
46
- Infect.run
47
- end