coffee_enhancer 0.1.0 → 0.1.1

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: 57edec0e1d1e4eadfdec61343f329cb79366b61c
4
- data.tar.gz: 53f8462cc18adae4fcce00ff08f8421df424d579
3
+ metadata.gz: 99c272747e8b989e54a7e35e24a725dcd9e6a8dc
4
+ data.tar.gz: 1d3c82b89db67bbf711f5df930c78e59d0818f84
5
5
  SHA512:
6
- metadata.gz: 280b08c79641133d7d8d336c811ea853011654a2e975f2d89426ab2829346cf4985b9a24fa61d00a81c2f6c713b8dd468cd3abdf0e003485c505bd920840bec2
7
- data.tar.gz: 956be4c455591ece63badcd5e1463c02d8dfb833876ae327c3b651357933683a45fbcdd8079ed79f3a5d09a55660eec7064cf9f9bd3eb5c02eddaea97f3a88f7
6
+ metadata.gz: 10dea5fae5b7028412a22df5bca5ca53f94adadc5703c26a6bd6f49a48437281267f3ed2fb30f3daafe897b03e8e304b06fc296bc3c341abd699206ef45eac27
7
+ data.tar.gz: 778c72ccff1e79b5b2348d7d789dfdec329ac8372e4c594ed27026f079c840caebad5dcc59f3481ae8206f4ad0066c11cfcbb07fb7f7516f46c4f2c5dc4410d0
data/README.md CHANGED
@@ -21,11 +21,102 @@ Or install it yourself as:
21
21
 
22
22
  ## Usage
23
23
 
24
- TODO: Write usage instructions here
24
+ Add this to your application.js file:
25
+
26
+ ```ruby
27
+ //= coffee_enhancer
28
+ ```
29
+
30
+ ## Documentation
31
+
32
+ **Adds the following methods for coffee/js :**
33
+
34
+ ```coffescript
35
+
36
+ # Checks if array or string element is present
37
+ Array::present()
38
+
39
+ # Checks if array element is empty
40
+ Array::empty()
41
+
42
+ # Checks if array element is empty
43
+ Array::any()
44
+
45
+ # Formats time to 12 hour clock time
46
+ Date::formatted_time_with_pm()
47
+
48
+ # Formats time to 24 hour clock time
49
+ Date::formatted_time()
50
+
51
+ # Formats date
52
+ Date::formatted_date()
53
+
54
+ # Gives an english string describing the time since datetime stamp
55
+ Date::time_ago_in_words()
56
+
57
+ # Method that checks if a certain variable is undefined or null
58
+ non_existent(variable)
59
+
60
+ # Method that checks if a certain variable is defined and not null
61
+ exists(variable)
62
+
63
+ # Method that checks if a certain variable is defined
64
+ defined(variable)
65
+
66
+ # Method that checks if a certain variable is undefined
67
+ not_defined(variable)
68
+
69
+ # Method that checks if a certain variable is loaded (used in ReactJs mostly)
70
+ loaded(variable)
71
+
72
+ # Checks if number is positive or equal to zero
73
+ Number::is_positive()
74
+
75
+ # Checks if number is equal to zero
76
+ Number::is_zero()
77
+
78
+ # Checks if number is smaller or equal to zero
79
+ Number::is_negative()
80
+
81
+ # Converts to currency
82
+ Number::to_currency()
83
+
84
+ # Converts to string
85
+ Number::to_s()
86
+
87
+ # Converts to integer
88
+ Number::to_i()
89
+
90
+ # Checks if string element is blank
91
+ String::blank()
92
+
93
+ # Checks if string element is empty
94
+ String::empty()
95
+
96
+ # Checks if string element is present
97
+ String::present()
98
+
99
+ # Converts string to integer
100
+ String::to_i()
101
+ parseInt(@)
102
+
103
+ # Converts string to float
104
+ String::to_f()
105
+
106
+ # Converts the first character of string to uppercase and the rest to downcase
107
+ String::capitalize()
108
+
109
+ # Removes whitespaces before and after the content of the string
110
+ String::trim()
111
+
112
+ # Converts the first character of each word to uppercase and the rest to downcase
113
+ String::titleize()
114
+
115
+ ```
25
116
 
26
117
  ## Development
27
118
 
28
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
119
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake jasmine:ci` to run the tests.
29
120
 
30
121
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
31
122
 
@@ -26,7 +26,7 @@ Date::formatted_time = ->
26
26
  minute = @getMinutes()
27
27
  "#{hour}:#{minute}"
28
28
 
29
- ## Formats date to 24 hour clock time
29
+ ## Formats date
30
30
  Date::formatted_date = ->
31
31
  day = @getDate()
32
32
  monthIndex = @getMonth()
@@ -1,4 +1,4 @@
1
- ## Checks if string element is blank
1
+ ## Checks if string element is blank, empty or present
2
2
  String::blank = ->
3
3
  not @.replace(/^\s+|\s+|\n+$/g, '')?.length
4
4
 
@@ -16,14 +16,15 @@ String::to_i = ->
16
16
  String::to_f = ->
17
17
  parseFloat(@)
18
18
 
19
- ## Converts the first character of string to uppercase
19
+ ## Converts the first character of string to uppercase and the rest to lowercase
20
20
  String::capitalize = ->
21
- "#{@.charAt(0).toUpperCase()}#{@.substr(1)}"
21
+ "#{@.charAt(0).toUpperCase()}#{@.substr(1).toLowerCase()}"
22
22
 
23
+ ## Removes the whitespace before and after the content of the string
23
24
  String::trim = ->
24
25
  @.replace /^\s+|\s+$/g, ''
25
26
 
26
- ## Converts the first character of each word to uppercase
27
+ ## Converts the first character of each word to uppercase and the rest to lowercase
27
28
  String::titleize = ->
28
29
  title = ''
29
30
  for word in @.toLowerCase().split(' ')
@@ -1,3 +1,3 @@
1
1
  module CoffeeEnhancer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffee_enhancer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Fugere
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script