A simple function to help with file content access #25

Merged
merged 3 commits into from Jul 17, 2013

Conversation

Projects
None yet
2 participants
@jeluard
Contributor

jeluard commented May 13, 2013

No description provided.

@Raynes

View changes

test/tentacles/gists_test.clj
+(deftest files-are-parsed
+ (let [files (gists/file-contents gist)]
+ (is (= (count files) 2))
+ (is (= (get-in files [:file1]) "content1"))))

This comment has been minimized.

Show comment Hide comment
@Raynes

Raynes Jul 17, 2013

Owner

This is just (:file1 files).

@Raynes

Raynes Jul 17, 2013

Owner

This is just (:file1 files).

@Raynes

View changes

src/tentacles/gists.clj
+ "Extract a file->content map from a gist"
+ [gist]
+ (if-let [files (:files gist)]
+ (zipmap (keys files) (map #(:content (second %)) files))))

This comment has been minimized.

Show comment Hide comment
@Raynes

Raynes Jul 17, 2013

Owner

(comp :content second)

@Raynes

Raynes Jul 17, 2013

Owner

(comp :content second)

@jeluard

This comment has been minimized.

Show comment Hide comment
@jeluard

jeluard Jul 17, 2013

Contributor

Thanks for the comments! Should be cleaned now.

Contributor

jeluard commented Jul 17, 2013

Thanks for the comments! Should be cleaned now.

Raynes added a commit that referenced this pull request Jul 17, 2013

Merge pull request #25 from jeluard/master
A simple function to help with file content access

@Raynes Raynes merged commit f28a7c8 into Raynes:master Jul 17, 2013

@Raynes

This comment has been minimized.

Show comment Hide comment
@Raynes

Raynes Jul 17, 2013

Owner

Awesome! Thank you.

Sorry it took me so long to get to this.

Owner

Raynes commented Jul 17, 2013

Awesome! Thank you.

Sorry it took me so long to get to this.

@jeluard

This comment has been minimized.

Show comment Hide comment
@jeluard

jeluard Jul 17, 2013

Contributor

No worries! It wasn't very important anyway.

Contributor

jeluard commented Jul 17, 2013

No worries! It wasn't very important anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment