new_operators 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in new_operators.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,3 @@
1
+ module NewOperators
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,21 @@
1
+ module NewOperators
2
+ def self.included(base)
3
+ base.extend ClassMethods
4
+ end
5
+
6
+ def ^(x)
7
+ product = x
8
+ x.times do
9
+ product = product * self
10
+ end
11
+ return "#{self}^#{x} = #{product}"
12
+ end
13
+
14
+ module ClassMethods
15
+ ## class methods would go here
16
+ end
17
+ end
18
+
19
+ class Fixnum
20
+ include NewOperators
21
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "new_operators/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "new_operators"
7
+ s.version = NewOperators::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Charlie McElfresh"]
10
+ s.email = ["charlie@mcelfresh.com"]
11
+ s.homepage = "http://demo.mcelfresh.info"
12
+ s.summary = %q{Creates a new exponent operator}
13
+ s.description = %q{Creates a new exponent operator ^, meaning "to the power of", where, for example, 3^3=81}
14
+
15
+ s.rubyforge_project = "new_operators"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: new_operators
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Charlie McElfresh
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-09 00:00:00 Z
14
+ dependencies: []
15
+
16
+ description: Creates a new exponent operator ^, meaning "to the power of", where, for example, 3^3=81
17
+ email:
18
+ - charlie@mcelfresh.com
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files: []
24
+
25
+ files:
26
+ - .gitignore
27
+ - Gemfile
28
+ - Rakefile
29
+ - lib/new_operators.rb
30
+ - lib/new_operators/version.rb
31
+ - new_operators.gemspec
32
+ homepage: http://demo.mcelfresh.info
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options: []
37
+
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ requirements: []
53
+
54
+ rubyforge_project: new_operators
55
+ rubygems_version: 1.7.2
56
+ signing_key:
57
+ specification_version: 3
58
+ summary: Creates a new exponent operator
59
+ test_files: []
60
+