notation 0.1.1 → 0.1.2

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: f71600bdd1d1131f1e23cf9c553b845326e8a5c5
4
- data.tar.gz: 5475de1bc916ca9fba2bd61d8298a94f46d51eef
3
+ metadata.gz: e896895146bf8d546110ba033057890aaf8c372d
4
+ data.tar.gz: bca0b8afbc63fed6a91284590560b7f5673b9868
5
5
  SHA512:
6
- metadata.gz: e6e8659943cb09e3c87b5b5008d80306f0b6d0240bd385151d510471d554986468034589ca9f6fa6a8d296d773e6e82cd96f2416f5f5f4f00a1ad9b5eca77b4f
7
- data.tar.gz: 021fcbcd4c87cfa510c6c087b7787065076363152fdfd34fd0e7f80b474e9390471ae55f27cc7977ed5158d194b4e6a93a858a41f338c3b0efa133cdb2e01368
6
+ metadata.gz: abe382bf07d844daca83ad527a1b4c26421925192d45be235ecb91205dfea20361404ae3fef9ae1e1518dc33540048b78f3294315e190996e165aa6024572797
7
+ data.tar.gz: d471e409557d07ec34949ec3e8c3aa5572ca4e97699e3b497ab7b7cb044658117f874fd932fbc60f877d830f8af6be9e6e03ced52a92554260512508f02d7aa0
@@ -0,0 +1 @@
1
+ d ����4ܙgU�Ǖ
@@ -0,0 +1,2 @@
1
+ %L�|��3j~z���灍�
2
+ IVj�T~�B���8����0���W)"e�Dp_��Q�l$�{.?,�H��et8큗ӭ��?��U����ۥ�� ��/���E� ������kP+ư��+y�v�yS�P +b)䚳e����Es.���CM���X�d%{��{��� �s��p8�IF���o!��?\�?���؜��!�+a،���>��0b��{���2Yu#��|�(��oxa��VD���>,U�א
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ = 0.1.2 - 12-Dec-2015
2
+ * Added the ∏ (pi product) method.
3
+ * This gem is now signed.
4
+ * The gem related tasks in the Rakefile now assume Rubygems 2.x.
5
+ * Modified the ∑ method to be a one-liner.
6
+
1
7
  = 0.1.1 - 9-Oct-2014
2
8
  * Updated gem:create and gem:install tasks.
3
9
  * Updated gemspec to include license, current home page.
data/MANIFEST CHANGED
@@ -3,5 +3,6 @@
3
3
  * README
4
4
  * Rakefile
5
5
  * notation.gemspec
6
+ * certs/djberg96_pub.pem
6
7
  * lib/notation.rb
7
8
  * test/test_notation.rb
data/README CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  λ { puts "hello" } # => "Hello"
12
12
  ∑ [1,2,3] # => 6
13
+ ∏ [2,3,4] # => 24
13
14
  √ 49 # => 7.0
14
15
 
15
16
  = Author's Notes
@@ -22,7 +23,7 @@
22
23
  no receiver. This is a limitation of the Ruby parser.
23
24
 
24
25
  = Copyright
25
- (C) 2009-2014 Daniel J. Berger
26
+ (C) 2009-2015 Daniel J. Berger
26
27
  All Rights Reserved
27
28
 
28
29
  = License
data/Rakefile CHANGED
@@ -7,13 +7,10 @@ CLEAN.include("**/*.gem", "**/*.rbc")
7
7
  namespace :gem do
8
8
  desc 'Build the notation gem'
9
9
  task :create => [:clean] do
10
+ require 'rubygems/package'
10
11
  spec = eval(IO.read('notation.gemspec'))
11
- if Gem::VERSION.to_f < 2.0
12
- Gem::Builder.new(spec).build
13
- else
14
- require 'rubygems/package'
15
- Gem::Package.build(spec)
16
- end
12
+ spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
13
+ Gem::Package.build(spec, true)
17
14
  end
18
15
 
19
16
  desc 'Install the notation library as a gem'
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
3
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
+ MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
5
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8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
6
6
  # Version of the notation library
7
- NOTATION_VERSION = '0.1.1'
7
+ NOTATION_VERSION = '0.1.2'
8
8
 
9
9
  # Make lambda a true lambda
10
10
  #
11
11
  # Example:
12
- # λ { puts 'Hello' }.call => 'Hello'
12
+ # λ { puts 'Hello' }.call => 'Hello'
13
13
  #
14
14
  alias λ proc
15
15
 
16
16
  # Sigma, i.e. the sum of all elements.
17
17
  #
18
18
  # Example:
19
- # ∑ [1,2,3] => 6
19
+ # ∑ [1,2,3] => 6
20
20
  #
21
21
  def ∑(*args)
22
- sum = 0
23
- args.each{ |e| sum += e }
24
- sum
22
+ args.inject(0){ |e,m| m += e }
23
+ end
24
+
25
+ # Pi product, i.e. the product of all elements.
26
+ #
27
+ # Example:
28
+ # ∏ [2,3,4] => 24
29
+ #
30
+ def ∏(*args)
31
+ args.inject(1){ |e,m| m *= e }
25
32
  end
26
33
 
27
34
  # Square root
@@ -1,15 +1,16 @@
1
1
  require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |gem|
4
- gem.name = 'notation'
5
- gem.version = '0.1.1'
6
- gem.author = 'Daniel J. Berger'
7
- gem.email = 'djberg96@gmail.com'
8
- gem.license = 'Artistic 2.0'
9
- gem.homepage = 'https://github.com/djberg96/notation'
10
- gem.summary = 'Unicode symbols that can be used as methods.'
11
- gem.test_file = 'test/test_notation.rb'
12
- gem.files = Dir['**/*'].delete_if{ |item| item.include?('git') }
4
+ gem.name = 'notation'
5
+ gem.version = '0.1.2'
6
+ gem.author = 'Daniel J. Berger'
7
+ gem.email = 'djberg96@gmail.com'
8
+ gem.license = 'Artistic 2.0'
9
+ gem.homepage = 'http://github.com/djberg96/notation'
10
+ gem.summary = 'Unicode symbols that can be used as methods.'
11
+ gem.test_file = 'test/test_notation.rb'
12
+ gem.files = Dir['**/*'].delete_if{ |item| item.include?('git') }
13
+ gem.cert_chain = Dir['certs/*']
13
14
 
14
15
  gem.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST']
15
16
  gem.add_development_dependency('rake')
@@ -10,7 +10,7 @@ require 'notation'
10
10
 
11
11
  class TC_Notation < Test::Unit::TestCase
12
12
  def test_version
13
- assert_equal('0.1.1', NOTATION_VERSION)
13
+ assert_equal('0.1.2', NOTATION_VERSION)
14
14
  end
15
15
 
16
16
  def test_sigma
@@ -18,6 +18,11 @@ class TC_Notation < Test::Unit::TestCase
18
18
  assert_equal(6, ∑(1,2,3))
19
19
  end
20
20
 
21
+ def test_pi
22
+ assert_respond_to(Kernel, :∏)
23
+ assert_equal(24, ∏(2,3,4))
24
+ end
25
+
21
26
  def test_square_root
22
27
  assert_respond_to(Kernel, :√)
23
28
  assert_equal(7.0, √(49))
metadata CHANGED
@@ -1,14 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain: []
11
- date: 2014-10-09 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
14
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
15
+ MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
16
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
17
+ bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyTkvXqRp6hLs9eoJOS
18
+ Hmi8kRYbq9Vkf15/hMxJpotYMgJVHHWrmDcC5Dye2PbnXjTkKf266Zw0PtT9h+lI
19
+ S3ts9HO+vaCFSMwFFZmnWJSpQ3CNw2RcHxjWkk9yF7imEM8Kz9ojhiDXzBetdV6M
20
+ gr0lV/alUr7TNVBDngbXEfTWscyXh1qd7xZ4EcOdsDktCe5G45N/o3662tPQvJsi
21
+ FOF0CM/KuBsa/HL1/eoEmF4B3EKIRfTHrQ3hu20Kv3RJ88QM4ec2+0dd97uX693O
22
+ zv6981fyEg+aXLkxrkViM/tz2qR2ZE0jPhHTREPYeMEgptRkTmWSKAuLVWrJEfgl
23
+ DtkCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFEwe
24
+ nn6bfJADmuIDiMSOzedOrL+xMB0GA1UdEQQWMBSBEmRqYmVyZzk2QGdtYWlsLmNv
25
+ bTAdBgNVHRIEFjAUgRJkamJlcmc5NkBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
26
+ ggEBAHmNOCWoDVD75zHFueY0viwGDVP1BNGFC+yXcb7u2GlK+nEMCORqzURbYPf7
27
+ tL+/hzmePIRz7i30UM//64GI1NLv9jl7nIwjhPpXpf7/lu2I9hOTsvwSumb5UiKC
28
+ /sqBxI3sfj9pr79Wpv4MuikX1XPik7Ncb7NPsJPw06Lvyc3Hkg5X2XpPtLtS+Gr2
29
+ wKJnmzb5rIPS1cmsqv0M9LPWflzfwoZ/SpnmhagP+g05p8bRNKjZSA2iImM/GyYZ
30
+ EJYzxdPOrx2n6NYR3Hk+vHP0U7UBSveI6+qx+ndQYaeyCn+GRX2PKS9h66YF/Q1V
31
+ tGSHgAmcLlkdGgan182qsE/4kKM=
32
+ -----END CERTIFICATE-----
33
+ date: 2015-12-12 00:00:00.000000000 Z
12
34
  dependencies:
13
35
  - !ruby/object:Gem::Dependency
14
36
  name: rake
@@ -35,14 +57,18 @@ extra_rdoc_files:
35
57
  - README
36
58
  - MANIFEST
37
59
  files:
60
+ - certs
61
+ - certs/djberg96_pub.pem
38
62
  - CHANGES
39
- - MANIFEST
40
- - README
41
- - Rakefile
63
+ - lib
42
64
  - lib/notation.rb
65
+ - MANIFEST
43
66
  - notation.gemspec
67
+ - Rakefile
68
+ - README
69
+ - test
44
70
  - test/test_notation.rb
45
- homepage: https://github.com/djberg96/notation
71
+ homepage: http://github.com/djberg96/notation
46
72
  licenses:
47
73
  - Artistic 2.0
48
74
  metadata: {}
@@ -62,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
88
  version: '0'
63
89
  requirements: []
64
90
  rubyforge_project:
65
- rubygems_version: 2.4.1
91
+ rubygems_version: 2.5.1
66
92
  signing_key:
67
93
  specification_version: 4
68
94
  summary: Unicode symbols that can be used as methods.
Binary file