File tree 4 files changed +27
-1
lines changed
4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 6
6
:dependencies [
7
7
[org.clojure/clojure " 1.10.3" ]
8
8
[prismatic/schema " 1.2.0" ]
9
+ [io.forward/yaml " 1.0.11" ]
9
10
]
10
11
:main ^:skip-aot clojure-noob.core
11
12
:target-path " target/%s"
Original file line number Diff line number Diff line change
1
+ name : " Karina"
2
+ surname : " Moreira"
3
+ profileDetails :
4
+ - birthday : " 18/05"
5
+ - numberOfPets : 1
6
+ - hobbies : ["manga", "series", "games"]
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ transformed-list
257
257
258
258
; max expects different arguments, but a vector
259
259
; is a single argument
260
- (max [0 1 2 ]) ; => [0 1 2]
260
+ ; (max [0 1 2]) ; => [0 1 2]
261
261
262
262
; apply explodes a seqable data structure
263
263
; like this vector, passing its values as arguments
Original file line number Diff line number Diff line change
1
+ (ns clojure-noob.side-studies.studies.yaml-stuff
2
+ (:require
3
+ [yaml.core :as yaml]
4
+ [clojure.java.io :as io]))
5
+
6
+ ; same effect
7
+ (-> (io/file " ." ) .getAbsolutePath)
8
+ (-> (java.io.File. " ." ) .getAbsolutePath)
9
+
10
+ (def yaml-filepath
11
+ " resources/yaml-example.yml" )
12
+
13
+ (slurp yaml-filepath)
14
+ (.exists (io/file yaml-filepath))
15
+ (.exists (io/resource yaml-filepath))
16
+
17
+ (yaml/from-file (io/file yaml-filepath))
18
+ (:surname (yaml/from-file (io/file yaml-filepath)))
19
+ (yaml/generate-string (yaml/from-file (io/file yaml-filepath)))
You can’t perform that action at this time.
0 commit comments