alisha 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Aleksandr Koss
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.
@@ -0,0 +1,17 @@
1
+ = alisha
2
+
3
+ Description goes here.
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (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)
13
+ * Send me a pull request. Bonus points for topic branches.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2010 Aleksandr Koss. See LICENSE for details.
@@ -0,0 +1,46 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "alisha"
8
+ gem.summary = %Q{Shell aliases manager}
9
+ gem.description = %Q{Shell aliases manager}
10
+ gem.email = "koss@nocorp.me"
11
+ gem.homepage = "http://github.com/kossnocorp/alisha"
12
+ gem.authors = ["Aleksandr Koss"]
13
+ gem.version = '0.1'
14
+ #gem.add_development_dependency "rspec", ">= 1.2.9"
15
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
+ end
17
+ Jeweler::GemcutterTasks.new
18
+ rescue LoadError
19
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
20
+ end
21
+
22
+ #require 'spec/rake/spectask'
23
+ #Spec::Rake::SpecTask.new(:spec) do |spec|
24
+ #spec.libs << 'lib' << 'spec'
25
+ #spec.spec_files = FileList['spec/**/*_spec.rb']
26
+ #end
27
+
28
+ #Spec::Rake::SpecTask.new(:rcov) do |spec|
29
+ #spec.libs << 'lib' << 'spec'
30
+ #spec.pattern = 'spec/**/*_spec.rb'
31
+ #spec.rcov = true
32
+ #end
33
+
34
+ #task :spec => :check_dependencies
35
+
36
+ #task :default => :spec
37
+
38
+ #require 'rake/rdoctask'
39
+ #Rake::RDocTask.new do |rdoc|
40
+ #version = File.exist?('VERSION') ? File.read('VERSION') : ""
41
+
42
+ #rdoc.rdoc_dir = 'rdoc'
43
+ #rdoc.title = "alisha #{version}"
44
+ #rdoc.rdoc_files.include('README*')
45
+ #rdoc.rdoc_files.include('lib/**/*.rb')
46
+ #end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require 'alisha'
5
+ rescue LoadError
6
+ require File.expand_path('../../lib/alisha', __FILE__)
7
+ end
@@ -0,0 +1,14 @@
1
+ require 'yaml'
2
+
3
+ begin
4
+ require 'alisha/ui'
5
+ require 'alisha/core'
6
+ rescue LoadError
7
+ require File.expand_path('../alisha/ui', __FILE__)
8
+ require File.expand_path('../alisha/core', __FILE__)
9
+ end
10
+
11
+ ALISHA_HOME = '~/.alisha'
12
+ ALISHA_HOME_PATH = File.expand_path(ALISHA_HOME)
13
+
14
+ Alisha::Core.load!
@@ -0,0 +1,19 @@
1
+ module Alisha
2
+ class Core
3
+ def self.load!
4
+ if ARGV.size == 0
5
+ UI.log 'Hi, my name is Alisha!'
6
+ UI.log 'I refresh my scripts, stand by!'
7
+ UI.log '...'
8
+ UI.error "Sorry :( I don't known how to do it. Yet. DIY please!"
9
+ else
10
+ aliases = YAML.load(File.open "#{ALISHA_HOME_PATH}/#{ARGV[0]}.yml", 'r')
11
+ command = "#{ARGV[0]} #{aliases[aliases.keys[0]][ARGV[1]]}"
12
+
13
+ UI.log "Running `#{command}` ;)"
14
+
15
+ exec command
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,26 @@
1
+ module Alisha
2
+ class UI
3
+ class << self
4
+ def log string
5
+ _log string
6
+ end
7
+
8
+ def error string
9
+ _log string, true
10
+ end
11
+
12
+ protected
13
+
14
+ def _log string, error = false
15
+ message_color = error ? 31 : 36
16
+
17
+ to_say = "\033[#{message_color}m=>#{error ? '' : "\033[0m"}"
18
+
19
+ to_say << ' ' << "B000000M!" if error
20
+ to_say << ' ' << string
21
+
22
+ puts to_say
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Alisha" 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 @@
1
+ --color
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'alisha'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: alisha
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ version: "0.1"
10
+ platform: ruby
11
+ authors:
12
+ - Aleksandr Koss
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-06-25 00:00:00 +07:00
18
+ default_executable: alisha
19
+ dependencies: []
20
+
21
+ description: Shell aliases manager
22
+ email: koss@nocorp.me
23
+ executables:
24
+ - alisha
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - LICENSE
29
+ - README.rdoc
30
+ files:
31
+ - .document
32
+ - .gitignore
33
+ - LICENSE
34
+ - README.rdoc
35
+ - Rakefile
36
+ - bin/alisha
37
+ - lib/alisha.rb
38
+ - lib/alisha/core.rb
39
+ - lib/alisha/ui.rb
40
+ - spec/alisha_spec.rb
41
+ - spec/spec.opts
42
+ - spec/spec_helper.rb
43
+ has_rdoc: true
44
+ homepage: http://github.com/kossnocorp/alisha
45
+ licenses: []
46
+
47
+ post_install_message:
48
+ rdoc_options:
49
+ - --charset=UTF-8
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ hash: 3
67
+ segments:
68
+ - 0
69
+ version: "0"
70
+ requirements: []
71
+
72
+ rubyforge_project:
73
+ rubygems_version: 1.3.7
74
+ signing_key:
75
+ specification_version: 3
76
+ summary: Shell aliases manager
77
+ test_files:
78
+ - spec/alisha_spec.rb
79
+ - spec/spec_helper.rb