imsg 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dac40a3d498bacb0ab83b614669287a491b6d712
4
+ data.tar.gz: 4aea96d4f3b8b121a83e769044540662a1cebc6a
5
+ SHA512:
6
+ metadata.gz: f95cb6853f69d9c5033cae503ab1400dace08fc5d4057d627b6a032fa5807f59478d7c629bdf3aeb2b1e58b7a72b3937e24528d2818f7fc446d1be2579908d49
7
+ data.tar.gz: 5d94a9cc1f24d872bef60d8d20d89d9391fc22405a324b2be7e2af117ab110a792a99855978f950507e0dab758def9e8004fca43dddd77668d3f3bd9385b2e6c
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in imsg.gemspec
4
+ gemspec
@@ -0,0 +1,19 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ imsg (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.1.1)
10
+ rb-appscript (0.6.1)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ bundler (~> 1.5)
17
+ imsg!
18
+ rake
19
+ rb-appscript
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Christian Sampaio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,32 @@
1
+ # imsg
2
+
3
+ Tired of getting off your terminal screen to answer that dickheads friends of yours?
4
+ Now you can curse them right on the terminal!
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'imsg'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install imsg
19
+
20
+ ## Usage
21
+
22
+ imsg HELLLO FROM TERMINAL
23
+
24
+ ## Contributing
25
+
26
+ 1. Fork it ( http://github.com/chrisfsampaio/imsg/fork )
27
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
28
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
29
+ 4. Push to the branch (`git push origin my-new-feature`)
30
+ 5. Create new Pull Request
31
+
32
+ #<3
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+ require 'imsg'
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'imsg/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "imsg"
8
+ spec.version = Imsg::VERSION
9
+ spec.authors = ["Christian Sampaio"]
10
+ spec.email = ["christian.fsampaio@gmail.com"]
11
+ spec.date = '2014-02-11'
12
+ spec.summary = "Chat using iMessage on your terminal!"
13
+ spec.description = "Tired of getting off your terminal screen to answer that dickheads friends of yours? You can curse them right on the terminal now!"
14
+ spec.homepage = 'http://rubygems.org/gems/imsg'
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables << 'imsg'
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.5"
23
+ spec.add_development_dependency "rake"
24
+ spec.add_development_dependency "rb-appscript"
25
+ end
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env ruby
2
+ require "imsg/version"
3
+ require 'appscript'
4
+
5
+ def formatBuddies buddies
6
+ retVal = ""
7
+ count = 1
8
+ buddies.each do |buddy|
9
+ retVal += count.to_s + " - " +buddy.join(',') +"\n"
10
+ count += 1
11
+ end
12
+ retVal
13
+ end
14
+
15
+ def is_i str
16
+ !!(str =~ /^[-+]?[0-9]+$/)
17
+ end
18
+
19
+ str = ""
20
+ ARGV.each do |value|
21
+ str +=value+" "
22
+ end
23
+ str = str.chomp(' ');
24
+ ARGV.clear
25
+ STDOUT.flush
26
+
27
+ imsg = Appscript.app("Messages")
28
+ a = imsg.chats.participants.get()
29
+ b = []
30
+ a.each do |v|
31
+ names = []
32
+ v.each do |buddy|
33
+ names.push buddy.name.get()
34
+ end
35
+ b.push names
36
+ end
37
+ puts "\n\nTo which chat you wanna send your message?"
38
+ puts "(You can choose a number or type a buddy name/email)\n\n"
39
+ puts formatBuddies b
40
+
41
+
42
+ response = gets.chomp
43
+
44
+ if is_i response
45
+ puts "Sending \'#{str}\' to chat number #{response}"
46
+ `osascript -e 'tell application "Messages" to send \"#{str}\" to item #{response.to_i} of text chats'`
47
+ else
48
+ puts "Sending \'#{str}\' to buddy \'#{response}\'"
49
+ `osascript -e 'tell application "Messages" to send \"#{str}\" to buddy \"#{response}\"'`
50
+ end
@@ -0,0 +1,3 @@
1
+ module Imsg
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: imsg
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Christian Sampaio
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rb-appscript
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Tired of getting off your terminal screen to answer that dickheads friends
56
+ of yours? You can curse them right on the terminal now!
57
+ email:
58
+ - christian.fsampaio@gmail.com
59
+ executables:
60
+ - imsg
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - .gitignore
65
+ - Gemfile
66
+ - Gemfile.lock
67
+ - LICENSE
68
+ - README.md
69
+ - Rakefile
70
+ - bin/imsg
71
+ - imsg.gemspec
72
+ - lib/imsg.rb
73
+ - lib/imsg/version.rb
74
+ homepage: http://rubygems.org/gems/imsg
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Chat using iMessage on your terminal!
98
+ test_files: []