Skip to content

Commit

Permalink
v1.16.10. Bugfix.
Browse files Browse the repository at this point in the history
- v1.16.10 March 8, 2013
	- `balUtilModules` changes:
		- Fixed `requireFresh` regression, added test
  • Loading branch information
balupton committed Mar 7, 2013
1 parent 65b10d4 commit 7000893
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 19 deletions.
6 changes: 5 additions & 1 deletion History.md
@@ -1,6 +1,10 @@
## History

- v1.16.9 February 16, 2013
- v1.16.10 March 8, 2013
- `balUtilModules` changes:
- Fixed `requireFresh` regression, added test

- v1.16.9 March 8, 2013
- `balUtilModules` changes:
- Added `getLocaleCode`
- Added `getCountryCode`
Expand Down
12 changes: 8 additions & 4 deletions out/lib/modules.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions out/test/modules.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "bal-util",
"version": "1.16.9",
"version": "1.16.10",
"description": "Common utility functions for Node.js used and maintained by Benjamin Lupton",
"homepage": "https://github.com/balupton/bal-util",
"keywords": [
Expand Down
26 changes: 13 additions & 13 deletions src/lib/modules.coffee
Expand Up @@ -26,7 +26,19 @@ balUtilModules =
# Require the file without adding it into the cache
requireFresh: (path) ->
path = require('path').resolve(path)
delete require
delete require.cache[path] # clear require cache for the config file
result = require(path)
delete require.cache[path] # clear require cache for the config file
return result


# =================================
# Environments

# Is Windows
# Returns whether or not we are running on a windows machine
isWindows: ->
return isWindows

# Get Locale Code
getLocaleCode: (lang=null) ->
Expand All @@ -47,18 +59,6 @@ balUtilModules =
return countryCode


# =================================
# Environments

# Is Windows
# Returns whether or not we are running on a windows machine
isWindows: ->
return isWindows

# Get Locale Code



# =====================================
# Open and Close Process

Expand Down
6 changes: 6 additions & 0 deletions src/test/modules.test.coffee
Expand Up @@ -11,6 +11,12 @@ travis = process.env.TRAVIS_NODE_VERSION?

joe.describe 'modules', (describe,it) ->

describe 'requireFresh', (describe,it) ->
it 'should fetch something', ->
result = balUtil.requireFresh(__dirname+'/../../package.json')
assert.ok(result)
assert.ok(result?.version)

describe 'locale', (describe,it) ->
describe 'getLocaleCode', (describe,it) ->
it 'should fetch something', ->
Expand Down

0 comments on commit 7000893

Please sign in to comment.