yeah 0.3.3 → 0.3.4

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: 9db2fc8ff3354619333aa00a484931deae0ac046
4
- data.tar.gz: 2a63e5a1070e65dbc01b6a201e9b40b4d6ec38f4
3
+ metadata.gz: e63e1abe8491c77fbd17d9ae4b040bf8349afba3
4
+ data.tar.gz: d4d7d868f5f130a4bf1949d5b3eedc4b4a84f329
5
5
  SHA512:
6
- metadata.gz: 5e96c8e05061378a88ac5f87ced6d1b3cc46d1e6bf02735b160a46024b3ff004f1022fb4f50e55a80b2f3b64a64890c8490c2dea444ddb913c47c642033d3beb
7
- data.tar.gz: 174bacd2f5af289ad36e34e8bacb399df47f3ad4e83992af01882b4e6e8de420ca28c7de8899a2ce844b00d1938bede3af3c393b669bc47bd6078f6ae8f09e19
6
+ metadata.gz: d77b196bb0caf20f8f5a95ff68c8cbe001508dbab5c138dbc7e3eab6cc3dac345bf2fc863203ea9873189a9c97ad98a66e4f0d31d6608520a28d14403b686569
7
+ data.tar.gz: d66c9ff09bf63fd247d22d1cf83866ea54aec9ab124309bb3aff0f8d49981ba71d57142bb6fa00934a963005f4fa792b4d260ff58cd4ab25592fcff764cb83cf
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ 0.3.4 (2014-08-22)
2
+ ------------------
3
+ * Fixed `yeah version` command (thanks Chris Olszewski)
4
+ * Fixed `Vector#normalize` (thanks meganemura)
5
+ * Flattened `Vector` math operator code
6
+ * `Vector#magnitude` as alias for `Vector#length`
7
+ * `Vector#unit` as alias for `Vector#normalize`
8
+ * Updated documentation
9
+
10
+ 0.3.3 (2014-08-18)
11
+ ------------------
12
+ * Fixed missing require for `yeah new` command (thanks audy)
13
+
14
+ 0.3.2 (2014-08-18)
15
+ ------------------
16
+ * First substantial working release!
data/README.md CHANGED
@@ -16,15 +16,15 @@ Practical Ruby video game framework, alpha stage
16
16
 
17
17
  ## Examples
18
18
 
19
- [![Asteroids](https://cdn.mediacru.sh/IkYZP46TmCsd.png)](https://yeahrb.github.io/yeah/examples/asteroids/runner.html)
19
+ [Code for all examples](https://github.com/yeahrb/examples)
20
20
 
21
- [*Asteroids*](https://yeahrb.github.io/yeah/examples/asteroids/runner.html)
22
- [(code)](https://github.com/yeahrb/yeah/tree/examples/examples/asteroids)
21
+ [![Asteroids](https://cdn.mediacru.sh/IkYZP46TmCsd.png)](https://yeahrb.github.io/examples/asteroids/runner.html)
23
22
 
24
- [![Random](https://cdn.mediacru.sh/KW9M6TndLry0.png)](https://yeahrb.github.io/yeah/examples/random/runner.html)
23
+ [*Asteroids*](https://yeahrb.github.io/examples/asteroids/runner.html)
25
24
 
26
- [*Random*](https://cdn.mediacru.sh/ZpyKf2TtdLqJ.png)
27
- [(code)](https://github.com/yeahrb/yeah/tree/examples/examples/random)
25
+ [![Random](https://cdn.mediacru.sh/KW9M6TndLry0.png)](https://yeahrb.github.io/examples/random/runner.html)
26
+
27
+ [*Random*](https://yeahrb.github.io/examples/random/runner.html)
28
28
 
29
29
 
30
30
  ## Usage
@@ -41,12 +41,16 @@ NOTE: This is alpha-stage software, expect changes!
41
41
 
42
42
  1. In a command line, enter `yeah new` to generate a new game project.
43
43
  2. Change into the new `game` directory, then enter `bundle install`.
44
- 3. Add game code to `code/game.rb`. No tutorials yet; please take a look at the [example code](https://github.com/yeahrb/yeah/tree/examples/examples) and [API reference](http://rdoc.info/github/yeahrb/yeah/9f065a6/frames).
44
+ 3. Add game code to `code/game.rb`. No tutorials yet; please take a look at the [example code](https://github.com/yeahrb/examples) and [API reference](http://rdoc.info/github/yeahrb/yeah/9f065a6/frames).
45
45
  4. Enter `yeah serve` and visit [http://localhost:1234](http://localhost:1234) to try the game.
46
46
 
47
47
 
48
- ## API Reference
48
+ ## Links
49
+
50
+ [0.3.3 API reference](http://rdoc.info/github/yeahrb/yeah/9f065a6/frames)
51
+
52
+ [Issue & feature tracker](https://github.com/yeahrb/yeah/issues)
49
53
 
50
- [0.3.3](http://rdoc.info/github/yeahrb/yeah/9f065a6/frames)
54
+ [Discussion via Gitter](https://gitter.im/yeahrb/yeah)
51
55
 
52
- [Edge](http://rdoc.info/github/yeahrb/yeah/master/frames)
56
+ [Author's email](mailto:skoofoo@gmail.com)
data/bin/yeah CHANGED
@@ -19,6 +19,7 @@ when 'serve'
19
19
  require 'yeah/web/server'
20
20
  Yeah::Web::Server.new.start
21
21
  when 'version'
22
+ require 'yeah/version'
22
23
  puts Yeah::VERSION
23
24
  else
24
25
  puts "Usage: yeah <command>"
@@ -1,8 +1,9 @@
1
1
  module Yeah
2
2
 
3
- # An `Asset` represents a file found in a project's `assets` directory.
3
+ # An `Asset` represents a file found in a project's `assets/` directory.
4
4
  # @abstract Provided by a `Platform`, subclassed to more specific assets.
5
5
  class Asset
6
+ # @param [String] path relative to `assets/`
6
7
  def initialize(path)
7
8
  raise NotImplementedError
8
9
  end
@@ -15,8 +16,8 @@ class Asset
15
16
  end
16
17
 
17
18
  # @!attribute path
18
- # @param [String] path to asset relative to `assets`
19
- # @return [String] path to asset relative to `assets`
19
+ # @param [String] path to asset relative to `assets/`
20
+ # @return [String] path to asset relative to `assets/`
20
21
 
21
22
  # @!method to_n
22
23
  # @return [Native] native representation of asset for platform
data/lib/yeah/vector.rb CHANGED
@@ -65,37 +65,45 @@ class Vector
65
65
  Math.sqrt(@components[0] ** 2 + @components[1] ** 2 + @components[2] ** 2)
66
66
  end
67
67
 
68
+ alias :magnitude :length
69
+
68
70
  # @return [Vector] vector of same direction whose length is 1
69
71
  def normalize
70
- self / magnitude
72
+ self / length
71
73
  end
72
74
 
75
+ alias :unit :normalize
76
+
73
77
  # @param [Vector] vector to add
74
- # @return [Vector] vector added into other vector
78
+ # @return [Vector] vector sum
75
79
  def +(vector)
76
- self.class.new(*
77
- [@components, vector.components].transpose.map { |cc|
78
- cc.reduce(:+) })
80
+ self.class.new(@components[0] + vector.components[0],
81
+ @components[1] + vector.components[1],
82
+ @components[2] + vector.components[2])
79
83
  end
80
84
 
81
85
  # @param [Vector] vector to subtract
82
- # @return [Vector] vector from which other vector was subtracted
86
+ # @return [Vector] vector difference
83
87
  def -(vector)
84
- self.class.new(*
85
- [@components, vector.components].transpose.map { |cc|
86
- cc.reduce(:-) })
88
+ self.class.new(@components[0] - vector.components[0],
89
+ @components[1] - vector.components[1],
90
+ @components[2] - vector.components[2])
87
91
  end
88
92
 
89
- # @param [Numeric] numeric value to multiply vector
90
- # @return [Vector] vector multiplied by a numeric value
93
+ # @param [Numeric] numeric to multiply vector by
94
+ # @return [Vector] vector product
91
95
  def *(numeric)
92
- self.class.new(*@components.map { |c| c * numeric })
96
+ self.class.new(@components[0] * numeric,
97
+ @components[1] * numeric,
98
+ @components[2] * numeric)
93
99
  end
94
100
 
95
- # @param [Numeric] numeric value to divide vector
96
- # @return [Vector] vector divided by a numeric value
101
+ # @param [Numeric] numeric to divide vector by
102
+ # @return [Vector] vector quotient
97
103
  def /(numeric)
98
- self.class.new(*@components.map { |c| c / numeric })
104
+ self.class.new(@components[0] / numeric,
105
+ @components[1] / numeric,
106
+ @components[2] / numeric)
99
107
  end
100
108
 
101
109
  # @return [Vector] identical vector
data/lib/yeah/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yeah
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yeah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artur Ostrega
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2014-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -88,6 +88,7 @@ executables:
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
+ - CHANGELOG.md
91
92
  - LICENSE.txt
92
93
  - README.md
93
94
  - bin/yeah
@@ -122,7 +123,7 @@ files:
122
123
  - opal/yeah/web/mouse.opal
123
124
  - opal/yeah/web/sound.opal
124
125
  - opal/yeah/web/ticker.opal
125
- homepage: https://github.com/skofo/yeah
126
+ homepage: https://github.com/yeahrb/yeah
126
127
  licenses:
127
128
  - MIT
128
129
  metadata: {}